@crvouga/mockingbird-service-junction 3.5.0 → 3.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3246,9 +3246,9 @@ var restoreNamespace = (sqlite, namespace, snapshot) => {
3246
3246
  sqlite.transaction(() => {
3247
3247
  sqlite.prepare("DELETE FROM mockingbird_records WHERE namespace = ?").run(namespace);
3248
3248
  sqlite.prepare("DELETE FROM mockingbird_sequences WHERE namespace = ?").run(namespace);
3249
- const record = sqlite.prepare("INSERT INTO mockingbird_records (namespace, collection, id, seq, value) VALUES (?, ?, ?, ?, ?)");
3249
+ const record2 = sqlite.prepare("INSERT INTO mockingbird_records (namespace, collection, id, seq, value) VALUES (?, ?, ?, ?, ?)");
3250
3250
  for (const row of snapshot.records) {
3251
- record.run(namespace, row.collection, row.id, row.seq, row.value);
3251
+ record2.run(namespace, row.collection, row.id, row.seq, row.value);
3252
3252
  }
3253
3253
  const sequence = sqlite.prepare("INSERT INTO mockingbird_sequences (namespace, name, kind, value) VALUES (?, ?, ?, ?)");
3254
3254
  for (const row of snapshot.sequences) {
@@ -3388,9 +3388,9 @@ var inferFields = (records) => {
3388
3388
  if (records.length === 0)
3389
3389
  return [];
3390
3390
  const sample = records.slice(0, SAMPLE);
3391
- const objects = sample.filter((record) => isRecord3(record.value));
3391
+ const objects = sample.filter((record2) => isRecord3(record2.value));
3392
3392
  if (objects.length === 0) {
3393
- const kinds = new Set(sample.map((record) => kindOf(record.value)));
3393
+ const kinds = new Set(sample.map((record2) => kindOf(record2.value)));
3394
3394
  const list = [...kinds];
3395
3395
  return [
3396
3396
  {
@@ -3401,8 +3401,8 @@ var inferFields = (records) => {
3401
3401
  ];
3402
3402
  }
3403
3403
  const root = /* @__PURE__ */ new Map();
3404
- for (const record of objects) {
3405
- for (const [key, value] of Object.entries(record.value)) {
3404
+ for (const record2 of objects) {
3405
+ for (const [key, value] of Object.entries(record2.value)) {
3406
3406
  const accum = root.get(key) ?? blankAccum(key);
3407
3407
  absorb(accum, value);
3408
3408
  root.set(key, accum);
@@ -3531,8 +3531,8 @@ var readStateRecord = (scope, name2, id) => {
3531
3531
  return fail(400, "collection name is not allowed");
3532
3532
  if (!RECORD_ID.test(id))
3533
3533
  return fail(400, "record id is not allowed");
3534
- const record = readRecord(collectionOf(scope.sqlite, scope.storageNamespace, name2), id);
3535
- return record ? { ok: true, value: record } : fail(404, `no record ${id} in ${name2}`);
3534
+ const record2 = readRecord(collectionOf(scope.sqlite, scope.storageNamespace, name2), id);
3535
+ return record2 ? { ok: true, value: record2 } : fail(404, `no record ${id} in ${name2}`);
3536
3536
  };
3537
3537
  var requireId = (id) => RECORD_ID.test(id) ? { ok: true, value: id } : fail(400, "id must be a single path segment");
3538
3538
  var createStateRecord = (scope, name2, input) => {
@@ -3692,7 +3692,7 @@ var stateAdminRoutes = (routes) => {
3692
3692
  };
3693
3693
 
3694
3694
  // ../core/dist/version.js
3695
- var PACKAGE_VERSION = true ? "3.5.0" : UNRELEASED_VERSION;
3695
+ var PACKAGE_VERSION = true ? "3.6.1" : UNRELEASED_VERSION;
3696
3696
 
3697
3697
  // ../core/dist/webhooks.js
3698
3698
  var json4 = (status, body) => new Response(JSON.stringify(body), {
@@ -5709,19 +5709,19 @@ var positiveOrNull = (value, field) => {
5709
5709
  var mergeLimits = (base, input) => {
5710
5710
  if (typeof input !== "object" || input === null || Array.isArray(input))
5711
5711
  throw new TypeError("limits must be an object");
5712
- const record = input;
5713
- for (const key of Object.keys(record)) {
5712
+ const record2 = input;
5713
+ for (const key of Object.keys(record2)) {
5714
5714
  if (!(key in DEFAULT_LIMITS))
5715
5715
  throw new TypeError(`unknown limit ${key}; one of ${Object.keys(DEFAULT_LIMITS).join(", ")}`);
5716
5716
  }
5717
5717
  const next = { ...base };
5718
- if (record.maxUsers !== void 0) next.maxUsers = positiveOrNull(record.maxUsers, "maxUsers");
5719
- if (record.rateLimitPerSecond !== void 0)
5720
- next.rateLimitPerSecond = positiveOrNull(record.rateLimitPerSecond, "rateLimitPerSecond");
5721
- if (record.simulateRequiresSandbox !== void 0) {
5722
- if (typeof record.simulateRequiresSandbox !== "boolean")
5718
+ if (record2.maxUsers !== void 0) next.maxUsers = positiveOrNull(record2.maxUsers, "maxUsers");
5719
+ if (record2.rateLimitPerSecond !== void 0)
5720
+ next.rateLimitPerSecond = positiveOrNull(record2.rateLimitPerSecond, "rateLimitPerSecond");
5721
+ if (record2.simulateRequiresSandbox !== void 0) {
5722
+ if (typeof record2.simulateRequiresSandbox !== "boolean")
5723
5723
  throw new TypeError("simulateRequiresSandbox must be a boolean");
5724
- next.simulateRequiresSandbox = record.simulateRequiresSandbox;
5724
+ next.simulateRequiresSandbox = record2.simulateRequiresSandbox;
5725
5725
  }
5726
5726
  return next;
5727
5727
  };
@@ -5813,7 +5813,8 @@ var JunctionState = class {
5813
5813
  orderByTransaction;
5814
5814
  /**
5815
5815
  * The lab account each order was placed with (`null`: Junction's platform account). Kept
5816
- * off the order record: Junction's `ClientFacingOrder` has no `lab_account_id`.
5816
+ * separately from the response: explicit profiles render this persisted association,
5817
+ * while the native profile retains its historical response shape.
5817
5818
  */
5818
5819
  orderLabAccounts;
5819
5820
  webhookEvents;
@@ -5833,6 +5834,10 @@ var JunctionState = class {
5833
5834
  /** Lab slug → the `billing_type` an order for that lab gets when it omits one. */
5834
5835
  labAccountOmissionPolicies = {};
5835
5836
  defaultBillingTypes = {};
5837
+ labAccountBehavior = {
5838
+ profile: "native",
5839
+ accounts: {}
5840
+ };
5836
5841
  /** Whether an unknown `user_id` is refused (`strict`) or created on first use. */
5837
5842
  identity = "strict";
5838
5843
  webhooksMuted = 0;
@@ -6535,6 +6540,43 @@ var labAccountFromClientFacing = (value, recordedTeamId) => {
6535
6540
  };
6536
6541
  };
6537
6542
 
6543
+ // src/lab-account-behavior.ts
6544
+ var record = (v) => !!v && typeof v === "object" && !Array.isArray(v);
6545
+ function labAccountBehaviorFrom(input) {
6546
+ if (!record(input) || !["native", "expected-contract", "sandbox-observed"].includes(String(input.profile)))
6547
+ throw new TypeError("lab account profile must be native, expected-contract or sandbox-observed");
6548
+ const accounts = input.accounts ?? {};
6549
+ if (!record(accounts)) throw new TypeError("lab account behavior accounts must be an object");
6550
+ const out = {};
6551
+ for (const [id, raw] of Object.entries(accounts)) {
6552
+ if (!id || !record(raw) || Object.keys(raw).some((k) => k !== "rejectBilling" && k !== "allowBilling"))
6553
+ throw new TypeError("invalid lab account sandbox policy");
6554
+ const policy = {};
6555
+ for (const field of ["rejectBilling", "allowBilling"]) {
6556
+ if (raw[field] === void 0) continue;
6557
+ if (!record(raw[field]))
6558
+ throw new TypeError(`${field} must map billing types to observations`);
6559
+ for (const [type, value] of Object.entries(raw[field])) {
6560
+ if (!BILLING_TYPES.includes(type))
6561
+ throw new TypeError("unknown billing type in sandbox policy");
6562
+ if (field === "rejectBilling") {
6563
+ if (typeof value !== "string" || !value.trim())
6564
+ throw new TypeError("billing rejection needs a detail string");
6565
+ policy.rejectBilling ??= {};
6566
+ policy.rejectBilling[type] = value;
6567
+ } else {
6568
+ if (!Array.isArray(value) || !value.every((v) => typeof v === "string" && US_STATES.includes(v)))
6569
+ throw new TypeError("billing exceptions need US state codes");
6570
+ policy.allowBilling ??= {};
6571
+ policy.allowBilling[type] = [...value];
6572
+ }
6573
+ }
6574
+ }
6575
+ out[id] = policy;
6576
+ }
6577
+ return { profile: input.profile, accounts: out };
6578
+ }
6579
+
6538
6580
  // src/lab-account-presets.ts
6539
6581
  var except = (...excluded) => US_STATES.filter((state) => !excluded.includes(state));
6540
6582
  var PLATFORM_ACCOUNT_STATES = except("NJ", "NY", "RI");
@@ -6613,18 +6655,18 @@ var expandLabAccountLayout = (layout, teamId) => {
6613
6655
  for (const entry of presets) {
6614
6656
  const name2 = typeof entry === "string" ? entry : entry?.name;
6615
6657
  const id = typeof entry === "string" ? void 0 : entry?.id;
6616
- const record = typeof name2 === "string" ? labAccountFromPreset(name2, { teamId, ...id !== void 0 ? { id } : {} }) : void 0;
6617
- if (!record)
6658
+ const record2 = typeof name2 === "string" ? labAccountFromPreset(name2, { teamId, ...id !== void 0 ? { id } : {} }) : void 0;
6659
+ if (!record2)
6618
6660
  throw new TypeError(
6619
6661
  `no lab-account preset ${JSON.stringify(name2)}; one of ${Object.keys(LAB_ACCOUNT_PRESETS).join(", ")}`
6620
6662
  );
6621
- records.push(record);
6663
+ records.push(record2);
6622
6664
  }
6623
6665
  for (const input of accounts) records.push(labAccountFromInput(input, teamId));
6624
6666
  const seen = /* @__PURE__ */ new Set();
6625
- for (const record of records) {
6626
- if (seen.has(record.id)) throw new TypeError(`lab account ${record.id} is declared twice`);
6627
- seen.add(record.id);
6667
+ for (const record2 of records) {
6668
+ if (seen.has(record2.id)) throw new TypeError(`lab account ${record2.id} is declared twice`);
6669
+ seen.add(record2.id);
6628
6670
  }
6629
6671
  return records;
6630
6672
  };
@@ -6919,8 +6961,8 @@ var junctionAdminRoutes = (options) => (runtime) => {
6919
6961
  "GET /lab-accounts/presets": (request2) => jsonRes(200, {
6920
6962
  presets: Object.fromEntries(
6921
6963
  Object.keys(LAB_ACCOUNT_PRESETS).map((name2) => {
6922
- const record = labAccountFromPreset(name2, { teamId: api(request2).teamId });
6923
- return [name2, record ? renderLabAccount(record) : null];
6964
+ const record2 = labAccountFromPreset(name2, { teamId: api(request2).teamId });
6965
+ return [name2, record2 ? renderLabAccount(record2) : null];
6924
6966
  })
6925
6967
  ),
6926
6968
  aliases: LAB_ACCOUNT_PRESET_ALIASES,
@@ -6933,8 +6975,8 @@ var junctionAdminRoutes = (options) => (runtime) => {
6933
6975
  }
6934
6976
  const name2 = request2.params.name;
6935
6977
  return guarded(() => {
6936
- const record = api(request2).addLabAccountPreset(name2, body.id);
6937
- return record ? jsonRes(201, record) : adminError4(
6978
+ const record2 = api(request2).addLabAccountPreset(name2, body.id);
6979
+ return record2 ? jsonRes(201, record2) : adminError4(
6938
6980
  404,
6939
6981
  `no lab-account preset ${name2}; one of ${Object.keys(LAB_ACCOUNT_PRESETS).join(", ")}`
6940
6982
  );
@@ -6947,6 +6989,11 @@ var junctionAdminRoutes = (options) => (runtime) => {
6947
6989
  const input = request2.body;
6948
6990
  return guarded(() => jsonRes(200, { limits: api(request2).configureLimits(input) }));
6949
6991
  },
6992
+ "GET /lab-account-behavior": (request2) => jsonRes(200, api(request2).labAccountBehavior),
6993
+ "PUT /lab-account-behavior": (request2) => guarded(() => {
6994
+ api(request2).labAccountBehavior = labAccountBehaviorFrom(request2.body);
6995
+ return jsonRes(200, api(request2).labAccountBehavior);
6996
+ }),
6950
6997
  "GET /default-billing-types": (request2) => jsonRes(200, { defaultBillingTypes: api(request2).defaultBillingTypes }),
6951
6998
  "PUT /default-billing-types": (request2) => {
6952
6999
  const input = isRecord6(request2.body) ? request2.body.defaultBillingTypes : void 0;
@@ -7129,14 +7176,14 @@ var materializeAvailabilityBookingKeys = (state, context, cachedBody) => {
7129
7176
  const slot = entry;
7130
7177
  const bookingKey = typeof slot.booking_key === "string" ? slot.booking_key : "";
7131
7178
  if (!bookingKey) continue;
7132
- const record = state.bookingKeys.get(bookingKey);
7133
- if (!record) continue;
7134
- if (modalityHint) record.modality = modalityHint;
7135
- record.zip_code = zip;
7136
- record.provider = record.modality === "patient_service_center" ? "quest" : "getlabs";
7137
- record.address = addressFromAvailabilityRequest(requestBody, zip);
7138
- record.location = zipLocation(zip);
7139
- state.bookingKeys.update(bookingKey, record);
7179
+ const record2 = state.bookingKeys.get(bookingKey);
7180
+ if (!record2) continue;
7181
+ if (modalityHint) record2.modality = modalityHint;
7182
+ record2.zip_code = zip;
7183
+ record2.provider = record2.modality === "patient_service_center" ? "quest" : "getlabs";
7184
+ record2.address = addressFromAvailabilityRequest(requestBody, zip);
7185
+ record2.location = zipLocation(zip);
7186
+ state.bookingKeys.update(bookingKey, record2);
7140
7187
  }
7141
7188
  }
7142
7189
  }
@@ -7160,13 +7207,13 @@ var rotateAvailabilityBookingKeys = (state, cachedBody, nowMs) => {
7160
7207
  const sealed = state.bookingKeys.get(sealedKey);
7161
7208
  if (!sealed) continue;
7162
7209
  const freshKey = bookingKeyRotationFor(state, sealedKey, nowMs, index);
7163
- const record = {
7210
+ const record2 = {
7164
7211
  ...sealed,
7165
7212
  key: freshKey,
7166
7213
  consumed_by_order_id: null,
7167
7214
  created_at: new Date(nowMs).toISOString()
7168
7215
  };
7169
- state.bookingKeys.insert(freshKey, record);
7216
+ state.bookingKeys.insert(freshKey, record2);
7170
7217
  entry.booking_key = freshKey;
7171
7218
  }
7172
7219
  }
@@ -7192,14 +7239,14 @@ var rotateGeneratedAvailabilityKeys = (state, days, nowMs, override) => {
7192
7239
  const current = state.bookingKeys.get(currentKey);
7193
7240
  if (!current) continue;
7194
7241
  const freshKey = bookingKeyRotationFor(state, currentKey, nowMs, index);
7195
- const record = {
7242
+ const record2 = {
7196
7243
  ...current,
7197
7244
  key: freshKey,
7198
7245
  ...override ?? {},
7199
7246
  consumed_by_order_id: null,
7200
7247
  created_at: new Date(nowMs).toISOString()
7201
7248
  };
7202
- state.bookingKeys.insert(freshKey, record);
7249
+ state.bookingKeys.insert(freshKey, record2);
7203
7250
  entry.booking_key = freshKey;
7204
7251
  }
7205
7252
  }
@@ -7662,7 +7709,7 @@ var phlebotomyAddress = (zip) => {
7662
7709
  };
7663
7710
  };
7664
7711
  var persistSlot = (state, seed, nowMs) => {
7665
- const record = {
7712
+ const record2 = {
7666
7713
  key: seed.bookingKey,
7667
7714
  start: seed.start,
7668
7715
  end: seed.end,
@@ -7679,8 +7726,8 @@ var persistSlot = (state, seed, nowMs) => {
7679
7726
  consumed_by_order_id: null,
7680
7727
  created_at: new Date(nowMs).toISOString()
7681
7728
  };
7682
- state.bookingKeys.insert(seed.bookingKey, record);
7683
- return record;
7729
+ state.bookingKeys.insert(seed.bookingKey, record2);
7730
+ return record2;
7684
7731
  };
7685
7732
  var generatePhlebotomySlots = (state, zip, startDate, provider, nowMs) => {
7686
7733
  const random = seededRandom2(seedFor(["phlebotomy", provider, zip, startDate]));
@@ -7713,15 +7760,15 @@ var generatePhlebotomySlots = (state, zip, startDate, provider, nowMs) => {
7713
7760
  address: phlebotomyAddress(zip),
7714
7761
  location: zipLocation(zip)
7715
7762
  };
7716
- const record = persistSlot(state, seed, nowMs);
7763
+ const record2 = persistSlot(state, seed, nowMs);
7717
7764
  slots.push({
7718
- booking_key: record.key,
7719
- start: record.start,
7720
- end: record.end,
7721
- expires_at: record.expires_at,
7722
- price: record.price,
7723
- is_priority: record.is_priority,
7724
- num_appointments_available: record.num_appointments_available
7765
+ booking_key: record2.key,
7766
+ start: record2.start,
7767
+ end: record2.end,
7768
+ expires_at: record2.expires_at,
7769
+ price: record2.price,
7770
+ is_priority: record2.is_priority,
7771
+ num_appointments_available: record2.num_appointments_available
7725
7772
  });
7726
7773
  }
7727
7774
  if (slots.length > 0) days.push({ date, slots });
@@ -7772,16 +7819,16 @@ var generatePscSlots = (state, zip, startDate, siteCodes, nowMs) => {
7772
7819
  } : phlebotomyAddress(zip),
7773
7820
  location: site?.location ?? zipLocation(zip)
7774
7821
  };
7775
- const record = persistSlot(state, seed, nowMs);
7822
+ const record2 = persistSlot(state, seed, nowMs);
7776
7823
  slots.push({
7777
- booking_key: record.key,
7778
- start: record.start,
7779
- end: record.end,
7780
- expires_at: record.expires_at,
7781
- price: record.price,
7782
- is_priority: record.is_priority,
7783
- num_appointments_available: record.num_appointments_available,
7784
- site_code: record.site_code
7824
+ booking_key: record2.key,
7825
+ start: record2.start,
7826
+ end: record2.end,
7827
+ expires_at: record2.expires_at,
7828
+ price: record2.price,
7829
+ is_priority: record2.is_priority,
7830
+ num_appointments_available: record2.num_appointments_available,
7831
+ site_code: record2.site_code
7785
7832
  });
7786
7833
  }
7787
7834
  if (slots.length > 0) days.push({ date, slots });
@@ -8281,14 +8328,14 @@ var schedulingHandlers = (state) => ({
8281
8328
  }
8282
8329
  const body = jsonObject(context);
8283
8330
  const bookingKey = typeof body.booking_key === "string" ? body.booking_key : "";
8284
- const record = bookingKey === "" ? void 0 : state.bookingKeys.get(bookingKey);
8285
- if (record?.modality !== "phlebotomy" || record.consumed_by_order_id !== null || record.expires_at !== null && new Date(record.expires_at).getTime() <= context.now()) {
8331
+ const record2 = bookingKey === "" ? void 0 : state.bookingKeys.get(bookingKey);
8332
+ if (record2?.modality !== "phlebotomy" || record2.consumed_by_order_id !== null || record2.expires_at !== null && new Date(record2.expires_at).getTime() <= context.now()) {
8286
8333
  invalidBookingKey();
8287
8334
  }
8288
8335
  const duplicate = state.appointments.list().map((entry) => entry.value).find(
8289
- (appointment2) => appointment2.user_id === order.user_id && appointment2.provider === "getlabs" && appointment2.status !== "cancelled" && appointment2.status !== "completed" && appointment2.start_at !== null && appointment2.end_at !== null && Date.parse(appointment2.start_at) < Date.parse(record.end) && Date.parse(appointment2.end_at) > Date.parse(record.start)
8336
+ (appointment2) => appointment2.user_id === order.user_id && appointment2.provider === "getlabs" && appointment2.status !== "cancelled" && appointment2.status !== "completed" && appointment2.start_at !== null && appointment2.end_at !== null && Date.parse(appointment2.start_at) < Date.parse(record2.end) && Date.parse(appointment2.end_at) > Date.parse(record2.start)
8290
8337
  );
8291
- if (record.provider === "getlabs" && duplicate) duplicatePatientAppointment(duplicate);
8338
+ if (record2.provider === "getlabs" && duplicate) duplicatePatientAppointment(duplicate);
8292
8339
  const nowIso = state.isoNow(context.now);
8293
8340
  const appointmentId = state.nextAppointmentId();
8294
8341
  const appointment = {
@@ -8298,17 +8345,17 @@ var schedulingHandlers = (state) => ({
8298
8345
  provider_id: state.appointmentProviderIdFor(`${order.id}:${bookingKey}`),
8299
8346
  external_id: `getlabs-${state.appointmentProviderIdFor(orderId)}`,
8300
8347
  type: "phlebotomy",
8301
- provider: record.provider,
8348
+ provider: record2.provider,
8302
8349
  // Vital quirk: top-level status + events[0].status are pending, but event_status is scheduled.
8303
8350
  status: "pending",
8304
8351
  event_status: "scheduled",
8305
- start_at: record.start,
8306
- end_at: record.end,
8307
- iana_timezone: zipTimezone(record.zip_code),
8308
- address: record.address,
8309
- location: observedPhlebotomyLocation(record.address) ?? record.location,
8352
+ start_at: record2.start,
8353
+ end_at: record2.end,
8354
+ iana_timezone: zipTimezone(record2.zip_code),
8355
+ address: record2.address,
8356
+ location: observedPhlebotomyLocation(record2.address) ?? record2.location,
8310
8357
  can_reschedule: true,
8311
- booking_key: record.key,
8358
+ booking_key: record2.key,
8312
8359
  site_code: null,
8313
8360
  appointment_notes: null,
8314
8361
  order_transaction_id: order.order_transaction.id,
@@ -8321,8 +8368,8 @@ var schedulingHandlers = (state) => ({
8321
8368
  appendAppointmentEvent(appointment, "scheduled", nowIso);
8322
8369
  state.appointments.insert(appointmentId, appointment);
8323
8370
  state.appointmentsByOrder.insert(order.id, { appointment_id: appointmentId });
8324
- record.consumed_by_order_id = order.id;
8325
- state.bookingKeys.update(record.key, record);
8371
+ record2.consumed_by_order_id = order.id;
8372
+ state.bookingKeys.update(record2.key, record2);
8326
8373
  linkAppointmentToOrder(
8327
8374
  state,
8328
8375
  order,
@@ -8354,14 +8401,14 @@ var schedulingHandlers = (state) => ({
8354
8401
  if (siteCode === "") {
8355
8402
  throw new HttpError(400, { detail: "site_code is required for PSC appointments" });
8356
8403
  }
8357
- const record = bookingKey === "" ? void 0 : state.bookingKeys.get(bookingKey);
8358
- if (record === void 0 || record.modality === "patient_service_center" && record.consumed_by_order_id !== null && record.consumed_by_order_id !== order.id || record.expires_at !== null && new Date(record.expires_at).getTime() <= context.now()) {
8404
+ const record2 = bookingKey === "" ? void 0 : state.bookingKeys.get(bookingKey);
8405
+ if (record2 === void 0 || record2.modality === "patient_service_center" && record2.consumed_by_order_id !== null && record2.consumed_by_order_id !== order.id || record2.expires_at !== null && new Date(record2.expires_at).getTime() <= context.now()) {
8359
8406
  invalidBookingKey();
8360
8407
  }
8361
- if (record.modality !== "patient_service_center") {
8408
+ if (record2.modality !== "patient_service_center") {
8362
8409
  throw new HttpError(400, { detail: "Booking key is not a patient service center slot" });
8363
8410
  }
8364
- if (record.site_code !== null && record.site_code !== siteCode) {
8411
+ if (record2.site_code !== null && record2.site_code !== siteCode) {
8365
8412
  throw new HttpError(400, { detail: "Booking key does not match the requested site" });
8366
8413
  }
8367
8414
  const nowIso = state.isoNow(context.now);
@@ -8370,19 +8417,19 @@ var schedulingHandlers = (state) => ({
8370
8417
  id: appointmentId,
8371
8418
  order_id: order.id,
8372
8419
  user_id: order.user_id,
8373
- provider_id: state.appointmentProviderIdFor(`${order.id}:${record.key}`),
8420
+ provider_id: state.appointmentProviderIdFor(`${order.id}:${record2.key}`),
8374
8421
  external_id: `quest-${state.appointmentProviderIdFor(orderId)}`,
8375
8422
  type: "patient_service_center",
8376
8423
  provider: "quest",
8377
8424
  status: "confirmed",
8378
8425
  event_status: "scheduled",
8379
- start_at: record.start,
8380
- end_at: record.end,
8381
- iana_timezone: zipTimezone(record.zip_code),
8382
- address: record.address,
8383
- location: record.location,
8426
+ start_at: record2.start,
8427
+ end_at: record2.end,
8428
+ iana_timezone: zipTimezone(record2.zip_code),
8429
+ address: record2.address,
8430
+ location: record2.location,
8384
8431
  can_reschedule: true,
8385
- booking_key: record.key,
8432
+ booking_key: record2.key,
8386
8433
  site_code: siteCode,
8387
8434
  appointment_notes: null,
8388
8435
  order_transaction_id: order.order_transaction.id,
@@ -8394,8 +8441,8 @@ var schedulingHandlers = (state) => ({
8394
8441
  appendAppointmentEvent(appointment, "scheduled", nowIso);
8395
8442
  state.appointments.insert(appointmentId, appointment);
8396
8443
  state.appointmentsByOrder.insert(order.id, { appointment_id: appointmentId });
8397
- record.consumed_by_order_id = order.id;
8398
- state.bookingKeys.update(record.key, record);
8444
+ record2.consumed_by_order_id = order.id;
8445
+ state.bookingKeys.update(record2.key, record2);
8399
8446
  linkAppointmentToOrder(
8400
8447
  state,
8401
8448
  order,
@@ -8425,23 +8472,23 @@ var schedulingHandlers = (state) => ({
8425
8472
  }
8426
8473
  if (appointment.status === "cancelled")
8427
8474
  throw new HttpError(400, { detail: "Cannot reschedule a cancelled appointment" });
8428
- const record = bookingKey === "" ? void 0 : state.bookingKeys.get(bookingKey);
8429
- if (record === void 0 || record.modality !== "phlebotomy" || record.consumed_by_order_id !== null && record.consumed_by_order_id !== order.id || record.expires_at !== null && new Date(record.expires_at).getTime() <= context.now()) {
8475
+ const record2 = bookingKey === "" ? void 0 : state.bookingKeys.get(bookingKey);
8476
+ if (record2 === void 0 || record2.modality !== "phlebotomy" || record2.consumed_by_order_id !== null && record2.consumed_by_order_id !== order.id || record2.expires_at !== null && new Date(record2.expires_at).getTime() <= context.now()) {
8430
8477
  invalidBookingKey();
8431
8478
  }
8432
8479
  const nowIso = state.isoNow(context.now);
8433
- appointment.start_at = record.start;
8434
- appointment.end_at = record.end;
8435
- appointment.iana_timezone = zipTimezone(record.zip_code);
8436
- appointment.address = record.address;
8437
- appointment.location = observedPhlebotomyLocation(record.address) ?? record.location;
8438
- appointment.booking_key = record.key;
8480
+ appointment.start_at = record2.start;
8481
+ appointment.end_at = record2.end;
8482
+ appointment.iana_timezone = zipTimezone(record2.zip_code);
8483
+ appointment.address = record2.address;
8484
+ appointment.location = observedPhlebotomyLocation(record2.address) ?? record2.location;
8485
+ appointment.booking_key = record2.key;
8439
8486
  const event = appendAppointmentEvent(appointment, "scheduled", nowIso);
8440
8487
  event.data = { origin: "patient", is_reschedule: true };
8441
8488
  appointment.event_data = event.data;
8442
8489
  state.appointments.update(appointment.id, appointment);
8443
- record.consumed_by_order_id = order.id;
8444
- state.bookingKeys.update(record.key, record);
8490
+ record2.consumed_by_order_id = order.id;
8491
+ state.bookingKeys.update(record2.key, record2);
8445
8492
  linkAppointmentToOrder(state, order, appointment, SCHEDULED_ORDER_EVENT.phlebotomy, nowIso);
8446
8493
  state.publishAppointmentWebhook(appointment, order.team_id, context.now());
8447
8494
  return jsonRes(200, renderAppointment(appointment));
@@ -8457,24 +8504,24 @@ var schedulingHandlers = (state) => ({
8457
8504
  if (appointment?.type !== "patient_service_center") notFound("No appointment for this order");
8458
8505
  if (appointment.status === "cancelled")
8459
8506
  throw new HttpError(400, { detail: "Cannot reschedule a cancelled appointment" });
8460
- const record = bookingKey === "" ? void 0 : state.bookingKeys.get(bookingKey);
8461
- if (record === void 0 || record.modality !== "patient_service_center" || record.consumed_by_order_id !== null && record.consumed_by_order_id !== order.id || record.expires_at !== null && new Date(record.expires_at).getTime() <= context.now()) {
8507
+ const record2 = bookingKey === "" ? void 0 : state.bookingKeys.get(bookingKey);
8508
+ if (record2 === void 0 || record2.modality !== "patient_service_center" || record2.consumed_by_order_id !== null && record2.consumed_by_order_id !== order.id || record2.expires_at !== null && new Date(record2.expires_at).getTime() <= context.now()) {
8462
8509
  invalidBookingKey();
8463
8510
  }
8464
- if (record.site_code !== null && appointment.site_code !== record.site_code) {
8511
+ if (record2.site_code !== null && appointment.site_code !== record2.site_code) {
8465
8512
  throw new HttpError(400, { detail: "Booking key does not match the appointment site" });
8466
8513
  }
8467
8514
  const nowIso = state.isoNow(context.now);
8468
- appointment.start_at = record.start;
8469
- appointment.end_at = record.end;
8470
- appointment.iana_timezone = zipTimezone(record.zip_code);
8471
- appointment.address = record.address;
8472
- appointment.location = record.location;
8473
- appointment.booking_key = record.key;
8515
+ appointment.start_at = record2.start;
8516
+ appointment.end_at = record2.end;
8517
+ appointment.iana_timezone = zipTimezone(record2.zip_code);
8518
+ appointment.address = record2.address;
8519
+ appointment.location = record2.location;
8520
+ appointment.booking_key = record2.key;
8474
8521
  appendAppointmentEvent(appointment, "scheduled", nowIso);
8475
8522
  state.appointments.update(appointment.id, appointment);
8476
- record.consumed_by_order_id = order.id;
8477
- state.bookingKeys.update(record.key, record);
8523
+ record2.consumed_by_order_id = order.id;
8524
+ state.bookingKeys.update(record2.key, record2);
8478
8525
  state.publishAppointmentWebhook(appointment, order.team_id, context.now());
8479
8526
  return jsonRes(200, renderAppointment(appointment));
8480
8527
  },
@@ -8881,7 +8928,7 @@ var pyIso = (value) => {
8881
8928
  const ms = (match?.[1] ?? "000").padEnd(6, "0");
8882
8929
  return `${date}T${time.slice(0, 8)}.${ms}+00:00`;
8883
8930
  };
8884
- var orderValidation = (body, now = Date.now) => {
8931
+ var orderValidation = (body, now = Date.now, allowAddOn = false) => {
8885
8932
  const errors = [];
8886
8933
  const userId = body.user_id;
8887
8934
  if (userId === void 0) errors.push(missingError(["body", "user_id"], body));
@@ -8915,8 +8962,10 @@ var orderValidation = (body, now = Date.now) => {
8915
8962
  } else if (os !== void 0) {
8916
8963
  const o = os;
8917
8964
  const ids = o.lab_test_ids;
8918
- if (ids === void 0) errors.push(missingError(["body", "order_set", "lab_test_ids"], o));
8919
- else if (!Array.isArray(ids)) {
8965
+ if (ids === void 0 && !(allowAddOn && o.add_on !== void 0))
8966
+ errors.push(missingError(["body", "order_set", "lab_test_ids"], o));
8967
+ else if (ids === void 0) {
8968
+ } else if (!Array.isArray(ids)) {
8920
8969
  errors.push({
8921
8970
  type: "list_type",
8922
8971
  loc: ["body", "order_set", "lab_test_ids"],
@@ -9103,14 +9152,14 @@ var aoeValidationError = (state, body) => {
9103
9152
  if (!Array.isArray(answers)) return void 0;
9104
9153
  for (const answer of answers) {
9105
9154
  if (typeof answer !== "object" || answer === null || Array.isArray(answer)) continue;
9106
- const record = answer;
9107
- if (typeof record.marker_id !== "number") continue;
9108
- const marker = state.listLabTests().flatMap((test) => test.markers ?? []).find((entry) => entry.id === record.marker_id);
9109
- if (!marker?.aoe) return `Marker id ${record.marker_id} does not have AOE.`;
9110
- const question = aoeQuestion(state, record.marker_id, record.question_id);
9155
+ const record2 = answer;
9156
+ if (typeof record2.marker_id !== "number") continue;
9157
+ const marker = state.listLabTests().flatMap((test) => test.markers ?? []).find((entry) => entry.id === record2.marker_id);
9158
+ if (!marker?.aoe) return `Marker id ${record2.marker_id} does not have AOE.`;
9159
+ const question = aoeQuestion(state, record2.marker_id, record2.question_id);
9111
9160
  if (!question)
9112
- return `Invalid question_id ${String(record.question_id)} for marker id ${record.marker_id}.`;
9113
- const answerCode = typeof record.answer === "string" ? record.answer.toUpperCase() : "";
9161
+ return `Invalid question_id ${String(record2.question_id)} for marker id ${record2.marker_id}.`;
9162
+ const answerCode = typeof record2.answer === "string" ? record2.answer.toUpperCase() : "";
9114
9163
  if (!question.answers.some((entry) => entry.code === answerCode))
9115
9164
  return `Invalid answer ${answerCode} for question ${question.value}.`;
9116
9165
  }
@@ -9326,7 +9375,7 @@ var orderHandlers = (state) => ({
9326
9375
  });
9327
9376
  }
9328
9377
  }
9329
- const errors = orderValidation(body, context.now);
9378
+ const errors = orderValidation(body, context.now, state.labAccountBehavior.profile !== "native");
9330
9379
  if (errors.length > 0) throw new HttpError(422, { detail: errors });
9331
9380
  const rawAddress = body.patient_address;
9332
9381
  if (typeof rawAddress === "object" && rawAddress !== null && !Array.isArray(rawAddress) && typeof rawAddress.country === "string" && /[^A-Za-z ]/.test(rawAddress.country ?? "")) {
@@ -9358,7 +9407,50 @@ var orderHandlers = (state) => ({
9358
9407
  const address = body.patient_address;
9359
9408
  const orderSetIds = typeof rawOrderSet === "object" && rawOrderSet !== null ? rawOrderSet.lab_test_ids : void 0;
9360
9409
  const labTestIds = Array.isArray(orderSetIds) ? orderSetIds : rawOrderSet === void 0 && singleLabTestId !== void 0 ? [singleLabTestId] : [];
9361
- if (labTestIds.length === 0) {
9410
+ const addOn = typeof rawOrderSet === "object" && rawOrderSet !== null ? rawOrderSet.add_on : void 0;
9411
+ const addOnRecord = addOn && typeof addOn === "object" && !Array.isArray(addOn) ? addOn : void 0;
9412
+ if (state.labAccountBehavior.profile !== "native" && addOn !== void 0) {
9413
+ if (!addOnRecord) throw new HttpError(422, { detail: "add_on must be an object" });
9414
+ if (labTestIds.length > 0)
9415
+ throw new HttpError(400, {
9416
+ detail: "Combining lab_test_ids and add_on is not supported by this profile"
9417
+ });
9418
+ }
9419
+ const providerIds = addOnRecord?.provider_ids;
9420
+ const markerIds = addOnRecord?.marker_ids;
9421
+ let customTest;
9422
+ if (addOnRecord && state.labAccountBehavior.profile !== "native") {
9423
+ if (providerIds !== void 0 && (!Array.isArray(providerIds) || !providerIds.every((id) => typeof id === "string")) || markerIds !== void 0 && (!Array.isArray(markerIds) || !markerIds.every((id) => Number.isInteger(id))))
9424
+ throw new HttpError(422, {
9425
+ detail: "add_on requires string provider_ids or integer marker_ids"
9426
+ });
9427
+ const requestedProviders = Array.isArray(providerIds) ? providerIds : [];
9428
+ const requestedMarkers = Array.isArray(markerIds) ? markerIds : [];
9429
+ const explicitAccount = state.listLabAccounts().find((a) => a.id === body.lab_account_id);
9430
+ const candidates = state.listLabTests().filter((t) => !explicitAccount || t.lab.slug === explicitAccount.lab);
9431
+ for (const template of candidates) {
9432
+ const pool = candidates.filter((t) => t.lab.slug === template.lab.slug).flatMap((t) => t.markers ?? []);
9433
+ const markers = [
9434
+ ...new Map(
9435
+ pool.filter(
9436
+ (m) => requestedProviders.includes(m.provider_id ?? "") || requestedMarkers.includes(m.id)
9437
+ ).map((m) => [m.id, m])
9438
+ ).values()
9439
+ ];
9440
+ if (markers.length && requestedProviders.every((id) => markers.some((m) => m.provider_id === id)) && requestedMarkers.every((id) => markers.some((m) => m.id === id))) {
9441
+ customTest = {
9442
+ ...template,
9443
+ id: deterministicUuid(
9444
+ `junction:add-on:${template.lab.slug}:${markers.map((m) => m.id).sort().join(",")}`
9445
+ ),
9446
+ markers,
9447
+ auto_generated: true
9448
+ };
9449
+ break;
9450
+ }
9451
+ }
9452
+ }
9453
+ if (labTestIds.length === 0 && !customTest) {
9362
9454
  throw new HttpError(400, {
9363
9455
  detail: "No markers found for the supplied lab tests. Please check the lab test ids"
9364
9456
  });
@@ -9369,7 +9461,7 @@ var orderHandlers = (state) => ({
9369
9461
  if (resolved.some((test) => test === void 0)) {
9370
9462
  throw new HttpError(400, { detail: "Test does not exist" });
9371
9463
  }
9372
- const labTests = resolved;
9464
+ const labTests = [...resolved, ...customTest ? [customTest] : []];
9373
9465
  const methods = new Set(
9374
9466
  labTests.map(
9375
9467
  (test) => typeof test.method === "string" && test.method.length > 0 ? test.method : ""
@@ -9385,16 +9477,23 @@ var orderHandlers = (state) => ({
9385
9477
  const stateError2 = labStateSupportError(labTest, address.state);
9386
9478
  if (stateError2) throw new HttpError(400, { detail: stateError2 });
9387
9479
  const labSlug = typeof labTest.lab?.slug === "string" ? labTest.lab.slug.toLowerCase() : "";
9388
- const labAccount = selectLabAccount(
9480
+ const requestedAccountId = typeof body.lab_account_id === "string" ? body.lab_account_id : null;
9481
+ const sandboxPlatformFallback = state.labAccountBehavior.profile === "sandbox-observed" && PLATFORM_ACCOUNT_LABS.includes(labSlug) && (requestedAccountId === null || !state.listLabAccounts().some((a) => a.id === requestedAccountId));
9482
+ const labAccount = sandboxPlatformFallback ? "platform" : selectLabAccount(
9389
9483
  labSlug,
9390
- typeof body.lab_account_id === "string" ? body.lab_account_id : null,
9484
+ requestedAccountId,
9391
9485
  state.teamId,
9392
9486
  state.listLabAccounts(),
9393
9487
  state.labAccountOmissionPolicies
9394
9488
  );
9489
+ if (state.labAccountBehavior.profile === "expected-contract" && labAccount !== "platform" && labAccount.lab !== labSlug)
9490
+ throw new HttpError(400, { detail: "Lab account does not belong to the selected lab" });
9395
9491
  const requestedBilling = typeof body.billing_type === "string" && body.billing_type !== "" ? body.billing_type : void 0;
9396
9492
  const billingType = requestedBilling ?? state.defaultBillingTypes[labSlug] ?? "client_bill";
9397
- const allowedStates = effectiveBilling(labAccount)[billingType];
9493
+ const sandboxPolicy = state.labAccountBehavior.profile === "sandbox-observed" && labAccount !== "platform" && typeof body.lab_account_id === "string" ? state.labAccountBehavior.accounts[labAccount.id] : void 0;
9494
+ const rejection = requestedBilling ? sandboxPolicy?.rejectBilling?.[requestedBilling] : void 0;
9495
+ if (rejection) throw new HttpError(400, { detail: rejection });
9496
+ const allowedStates = (requestedBilling ? sandboxPolicy?.allowBilling?.[requestedBilling] : void 0) ?? effectiveBilling(labAccount)[billingType];
9398
9497
  if (!allowedStates)
9399
9498
  throw new HttpError(400, {
9400
9499
  // An omitted billing_type that resolves to one the account lacks is reported against
@@ -9454,6 +9553,8 @@ var orderHandlers = (state) => ({
9454
9553
  provider_account_id: labAccount === "platform" ? null : labAccount.provider_account_id
9455
9554
  });
9456
9555
  const responseOrder = { ...order };
9556
+ if (state.labAccountBehavior.profile !== "native")
9557
+ responseOrder.lab_account_id = state.orderLabAccounts.get(order.id)?.lab_account_id ?? null;
9457
9558
  if (responseOrder.result_types === null) delete responseOrder.result_types;
9458
9559
  const response = {
9459
9560
  order: responseOrder,
@@ -9477,6 +9578,8 @@ var orderHandlers = (state) => ({
9477
9578
  );
9478
9579
  if (alreadyCancelled) {
9479
9580
  const responseOrder2 = { ...order };
9581
+ if (state.labAccountBehavior.profile !== "native")
9582
+ responseOrder2.lab_account_id = state.orderLabAccounts.get(order.id)?.lab_account_id ?? null;
9480
9583
  if (responseOrder2.result_types === null) delete responseOrder2.result_types;
9481
9584
  return jsonRes(200, {
9482
9585
  order: responseOrder2,
@@ -9515,6 +9618,8 @@ var orderHandlers = (state) => ({
9515
9618
  cascadeCancelAppointments(state, id, context.now());
9516
9619
  }
9517
9620
  const responseOrder = { ...order };
9621
+ if (state.labAccountBehavior.profile !== "native")
9622
+ responseOrder.lab_account_id = state.orderLabAccounts.get(order.id)?.lab_account_id ?? null;
9518
9623
  if (responseOrder.result_types === null) delete responseOrder.result_types;
9519
9624
  const response = {
9520
9625
  order: responseOrder,
@@ -9582,6 +9687,8 @@ var orderHandlers = (state) => ({
9582
9687
  applyDueSimulations(state, context);
9583
9688
  const fresh = state.orders.get(id) ?? orderMissing(state, context.operation.operationId, id);
9584
9689
  const body = { ...fresh };
9690
+ if (state.labAccountBehavior.profile !== "native")
9691
+ body.lab_account_id = state.orderLabAccounts.get(id)?.lab_account_id ?? null;
9585
9692
  if (body.result_types === null) delete body.result_types;
9586
9693
  return jsonRes(200, body);
9587
9694
  },
@@ -9994,7 +10101,7 @@ var fixtureErrorMessage = (error) => {
9994
10101
  };
9995
10102
 
9996
10103
  // src/generated/openapi.ts
9997
- var document = JSON.parse(`{"openapi":"3.1.0","info":{"title":"Junction API (Mockingbird subset)","description":"Stateful emulator subset of the Junction (Vital) API.\\nDocs: https://docs.junction.com/\\nAuth: https://docs.junction.com/api-details/junction-api\\nCreate user: https://docs.junction.com/api-reference/user/create-user\\nGet user: https://docs.junction.com/api-reference/user/get-user\\nDelete user: https://docs.junction.com/api-reference/user/delete-user\\nResolve user: https://docs.junction.com/api-reference/user/resolve-user\\nUpdate user: https://docs.junction.com/api-reference/user/patch-user\\nGet users: https://docs.junction.com/api-reference/user/get-users\\nCreate order: https://docs.junction.com/api-reference/lab-testing/create-order\\nGet order: https://docs.junction.com/api-reference/lab-testing/get-order\\nGet orders: https://docs.junction.com/api-reference/lab-testing/get-orders\\nGet order transaction: https://docs.junction.com/api-reference/lab-testing/order-transactions/get-order-transaction\\nGet order transaction result: https://docs.junction.com/api-reference/lab-testing/results/get-order-transaction-results\\nLab tests: https://docs.junction.com/api-reference/lab-testing/tests-paginated\\nLab tests (deprecated, unpaged): https://docs.junction.com/api-reference/lab-testing/tests/get-lab-tests\\nAppointment availability: https://docs.junction.com/api-reference/lab-testing/appointments/get-appointment-availability\\nBook appointment: https://docs.junction.com/api-reference/lab-testing/appointments/book-appointment\\nGet appointment: https://docs.junction.com/api-reference/lab-testing/appointments/get-appointment\\nReschedule appointment: https://docs.junction.com/api-reference/lab-testing/appointments/reschedule-appointment\\nCancel appointment: https://docs.junction.com/api-reference/lab-testing/appointments/cancel-appointment\\nAppointment cancellation reasons: https://docs.junction.com/api-reference/lab-testing/appointments/get-appointment-cancellation-reasons\\nArea info: https://docs.junction.com/api-reference/lab-testing/service-areas/get-area-info\\nPSC info: https://docs.junction.com/api-reference/lab-testing/service-areas/get-psc-info\\nLab locations: https://docs.junction.com/api-reference/lab-testing/service-areas/get-lab-locations\\nRaw results: https://docs.junction.com/api-reference/lab-testing/results/get-lab-results\\nResult metadata: https://docs.junction.com/api-reference/lab-testing/results/get-lab-results-metadata\\nResult PDF: https://docs.junction.com/api-reference/lab-testing/results/get-lab-result-pdf\\nRequisition form PDF: https://docs.junction.com/api-reference/lab-testing/orders/get-requisition-form\\nList labs: https://docs.junction.com/api-reference/lab-testing/tests/get-labs\\nTest markers: https://docs.junction.com/api-reference/lab-testing/tests/get-markers-for-lab-test\\nOrder-set markers: https://docs.junction.com/api-reference/lab-testing/results/get-order-set-markers\\nLatest user info: https://docs.junction.com/api-reference/user/get-latest-user-info\\n","version":"0.4.758","x-mockingbird-upstream":{"docs":"https://docs.junction.com/","note":"Hand-authored subset from Junction public OpenAPI snippets in the docs."}},"servers":[{"url":"https://api.sandbox.us.junction.com"}],"security":[{"apiKeyAuth":[]}],"paths":{"/v2/user":{"post":{"operationId":"create_user_v2_user_post","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserCreateBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientFacingUser"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientUserIDConflictResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"operationId":"get_teams_users_v2_user_get","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"parameters":[{"name":"offset","in":"query","required":false,"schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedUsersResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"500":{"description":"Internal Server Error","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/v2/user/{user_id}":{"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","x-mockingbird-resource-ref":{"type":"user","missing":"00000000-0000-4000-8000-000000000000"}}}],"get":{"operationId":"get_user_v2_user__user_id__get","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientFacingUser"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"operationId":"delete_user_v2_user__user_id__delete","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserSuccessResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"operationId":"patch_user_v2_user__user_id__patch","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserPatchBody"}}}},"responses":{"204":{"description":"Successful Response"},"400":{"description":"Nothing to patch","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/user/resolve/{client_user_id}":{"parameters":[{"name":"client_user_id","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"get":{"operationId":"get_user_by_client_user_id_v2_user_resolve__client_user_id__get","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ClientFacingUser"},{"$ref":"#/components/schemas/PaginatedUsersResponse"}]}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/user/{user_id}/info":{"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","x-mockingbird-resource-ref":{"type":"user","missing":"00000000-0000-4000-8000-000000000000"}}}],"patch":{"operationId":"patch_user_info_v2_user__user_id__info_patch","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserInfoPatchBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserInfo"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/user/{user_id}/info/latest":{"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","x-mockingbird-resource-ref":{"type":"user","missing":"00000000-0000-4000-8000-000000000000"}}}],"get":{"operationId":"get_latest_user_info_user_v2_user__user_id__info_latest_get","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserInfo"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v3/lab_test":{"get":{"operationId":"get_paginated_lab_tests_for_team_v3_lab_test_get","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LabTestResourcesResponse"}}}}}}},"/v3/lab_test/lab_account":{"get":{"operationId":"get_team_lab_accounts_v3_lab_test_lab_account_get","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":true,"reason":"lab-account inventory is fixture-owned; the emulator models the documented shape, filters and routing rules, not a live account inventory"}},"parameters":[{"name":"lab_account_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/LabAccountStatus"},{"type":"null"}]}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetTeamLabAccountsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v3/lab_tests":{"get":{"operationId":"get_lab_tests_for_team_v3_lab_tests_get","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"summary":"Get Lab Tests For Team","description":"GET all the lab tests the team has access to.","deprecated":true,"parameters":[{"name":"generation_method","in":"query","required":false,"schema":{"$ref":"#/components/schemas/LabTestGenerationMethodFilter","description":"Filter on whether auto-generated lab tests created by Vital, manually created lab tests, or all lab tests should be returned.","default":"manual"},"description":"Filter on whether auto-generated lab tests created by Vital, manually created lab tests, or all lab tests should be returned."},{"name":"lab_slug","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by the slug of the lab for these lab tests.","title":"Lab Slug"},"description":"Filter by the slug of the lab for these lab tests."},{"name":"collection_method","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/LabTestCollectionMethod"},{"type":"null"}],"description":"Filter by the collection method for these lab tests.","title":"Collection Method"},"description":"Filter by the collection method for these lab tests."},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/LabTestStatus"},{"type":"null"}],"description":"Filter by the status of these lab tests.","title":"Status"},"description":"Filter by the status of these lab tests."},{"name":"marker_ids","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"integer"}},{"type":"null"}],"description":"Filter to only include lab tests containing these marker IDs.","title":"Marker Ids"},"description":"Filter to only include lab tests containing these marker IDs."},{"name":"provider_ids","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Filter to only include lab tests containing these provider IDs.","title":"Provider Ids"},"description":"Filter to only include lab tests containing these provider IDs."},{"name":"name","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by the name of the lab test (a case-insensitive substring search).","title":"Name"},"description":"Filter by the name of the lab test (a case-insensitive substring search)."},{"name":"order_key","in":"query","required":false,"schema":{"anyOf":[{"enum":["price","created_at","updated_at"],"type":"string"},{"type":"null"}],"title":"Order Key"}},{"name":"order_direction","in":"query","required":false,"schema":{"enum":["asc","desc"],"type":"string","default":"asc","title":"Order Direction"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ClientFacingLabTest"},"title":"Response Get Lab Tests For Team V3 Lab Tests Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v3/lab_tests/{lab_test_id}":{"parameters":[{"name":"lab_test_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","x-mockingbird-resource-ref":{"type":"lab_test","missing":"00000000-0000-4000-8000-000000000000"}}}],"get":{"operationId":"get_lab_test_for_team_v3_lab_tests__lab_test_id__get","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientFacingLabTest"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v3/lab_tests/labs":{"get":{"operationId":"get_labs_v3_lab_tests_labs_get","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ClientFacingLab"}}}}}}}},"/v3/lab_tests/{lab_test_id}/markers":{"parameters":[{"name":"lab_test_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","x-mockingbird-resource-ref":{"type":"lab_test","missing":"00000000-0000-4000-8000-000000000000"}}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1}},{"name":"size","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"provider_id","in":"query","required":false,"schema":{"type":"string"}}],"get":{"operationId":"get_markers_for_lab_test_v3_lab_tests__lab_test_id__markers_get","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetMarkersResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v3/lab_tests/list_order_set_markers":{"post":{"operationId":"list_order_set_markers_v3_lab_tests_list_order_set_markers_post","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListOrderSetMarkersRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetMarkersResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v3/order":{"post":{"operationId":"create_order_v3_order_post","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrderRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostOrderResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"500":{"description":"Internal Server Error"}}}},"/v3/order/area/info":{"get":{"operationId":"get_area_info_v3_order_area_info_get","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":true,"reason":"central_labs presence, within_radius counts and getlabs market coverage are provider-owned geo data that an emulator cannot replicate per-zip; covered by the client-parity scenario shape checks instead"}},"parameters":[{"name":"zip_code","in":"query","required":true,"schema":{"type":"string","pattern":"^\\\\d{5}(?:-?\\\\d{4})?$"}},{"name":"radius","in":"query","required":false,"schema":{"$ref":"#/components/schemas/AllowedRadius"}},{"name":"lab_account_id","in":"query","required":false,"description":"Lab Account ID to use for availability checks","schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AreaInfo"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v3/order/psc/info":{"get":{"operationId":"get_psc_info_v3_order_psc_info_get","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":true,"reason":"patient_service_centers are real site inventories per zip (thousands of sites, result-capped at 30) that a fixture emulator cannot replicate per-zip; covered by the client-parity scenario shape checks instead"}},"parameters":[{"name":"zip_code","in":"query","required":true,"schema":{"type":"string","pattern":"^\\\\d{5}$"}},{"name":"lab_id","in":"query","required":true,"schema":{"type":"integer"}},{"name":"radius","in":"query","required":false,"schema":{"$ref":"#/components/schemas/AllowedRadius"}},{"name":"capabilities","in":"query","required":false,"schema":{"type":"array","items":{"$ref":"#/components/schemas/LabLocationCapability"}}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PscInfo"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v3/order/phlebotomy/appointment/availability":{"post":{"operationId":"get_phlebotomy_appointment_availability_v3_order_phlebotomy_appointment_availability_post","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":true,"reason":"availability slots are provider-side data whose values shift between sandbox calls; covered by the emulator-internal scheduling property suite instead"}},"parameters":[{"name":"start_date","in":"query","required":false,"schema":{"type":"string","format":"date"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsAddress"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppointmentAvailabilitySlots"}}}},"400":{"description":"Availability not bookable for this address","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"404":{"description":"No availability found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v3/order/phlebotomy/appointment/cancellation-reasons":{"get":{"operationId":"get_phlebotomy_appointment_cancellation_reason_v3_order_phlebotomy_appointment_cancellation_reasons_get","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ClientFacingAppointmentCancellationReason"}}}}}}}},"/v3/order/psc/appointment/availability":{"post":{"operationId":"get_psc_appointment_availability_v3_order_psc_appointment_availability_post","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":true,"reason":"availability slots are provider-side data whose values shift between sandbox calls; covered by the emulator-internal scheduling property suite instead"}},"parameters":[{"name":"lab","in":"query","required":true,"schema":{"$ref":"#/components/schemas/AppointmentPscLabs"}},{"name":"start_date","in":"query","required":false,"schema":{"type":"string","format":"date"}},{"name":"site_codes","in":"query","required":false,"schema":{"type":"string","description":"JSON-encoded array of site codes"}},{"name":"zip_code","in":"query","required":false,"schema":{"type":"string"}},{"name":"radius","in":"query","required":false,"schema":{"$ref":"#/components/schemas/AllowedRadius"}},{"name":"allow_stale","in":"query","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppointmentAvailabilitySlots"}}}},"400":{"description":"Availability not bookable for this address","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"404":{"description":"No slots found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v3/order/psc/appointment/cancellation-reasons":{"get":{"operationId":"get_psc_appointment_cancellation_reason_v3_order_psc_appointment_cancellation_reasons_get","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ClientFacingAppointmentCancellationReason"}}}}}}}},"/v3/order/{order_id}/phlebotomy/appointment":{"parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","x-mockingbird-resource-ref":{"type":"order","missing":"00000000-0000-4000-8000-000000000000"}}}],"get":{"operationId":"get_phlebotomy_appointment_v3_order__order_id__phlebotomy_appointment_get","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":true,"reason":"appointment payloads embed provider-side slot data; covered by the emulator-internal scheduling property suite instead"}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientFacingAppointment"}}}},"404":{"description":"No appointment for this order","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v3/order/{order_id}/phlebotomy/appointment/book":{"parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","x-mockingbird-resource-ref":{"type":"order","missing":"00000000-0000-4000-8000-000000000000"}}}],"post":{"operationId":"book_phlebotomy_appointment_v3_order__order_id__phlebotomy_appointment_book_post","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":true,"reason":"booking depends on live provider slot state; covered by the emulator-internal scheduling property suite instead"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppointmentBookingRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientFacingAppointment"}}}},"400":{"description":"Booking failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"404":{"description":"Order not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v3/order/{order_id}/phlebotomy/appointment/reschedule":{"parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","x-mockingbird-resource-ref":{"type":"order","missing":"00000000-0000-4000-8000-000000000000"}}}],"patch":{"operationId":"reschedule_phlebotomy_appointment_v3_order__order_id__phlebotomy_appointment_reschedule_patch","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":true,"reason":"rescheduling depends on live provider slot state; covered by the emulator-internal scheduling property suite instead"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppointmentRescheduleRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientFacingAppointment"}}}},"400":{"description":"Invalid or expired booking key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"404":{"description":"No appointment for this order","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v3/order/{order_id}/phlebotomy/appointment/cancel":{"parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","x-mockingbird-resource-ref":{"type":"order","missing":"00000000-0000-4000-8000-000000000000"}}}],"patch":{"operationId":"cancel_phlebotomy_appointment_v3_order__order_id__phlebotomy_appointment_cancel_patch","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":true,"reason":"cancellation depends on live provider appointment state; covered by the emulator-internal scheduling property suite instead"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PhlebotomyAppointmentCancelRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientFacingAppointment"}}}},"400":{"description":"Invalid cancellation reason","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"404":{"description":"No appointment for this order","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v3/order/{order_id}/psc/appointment":{"parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","x-mockingbird-resource-ref":{"type":"order","missing":"00000000-0000-4000-8000-000000000000"}}}],"get":{"operationId":"get_psc_appointment_v3_order__order_id__psc_appointment_get","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":true,"reason":"appointment payloads embed provider-side slot data; covered by the emulator-internal scheduling property suite instead"}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientFacingAppointment"}}}},"404":{"description":"No appointment for this order","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v3/order/{order_id}/psc/appointment/book":{"parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","x-mockingbird-resource-ref":{"type":"order","missing":"00000000-0000-4000-8000-000000000000"}}}],"post":{"operationId":"book_psc_appointment_v3_order__order_id__psc_appointment_book_post","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":true,"reason":"booking depends on live provider slot state; covered by the emulator-internal scheduling property suite instead"}},"parameters":[{"name":"x-idempotency-key","in":"header","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PscAppointmentBookingRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientFacingAppointment"}}}},"400":{"description":"Booking failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"404":{"description":"Order not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v3/order/{order_id}/psc/appointment/reschedule":{"parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","x-mockingbird-resource-ref":{"type":"order","missing":"00000000-0000-4000-8000-000000000000"}}}],"patch":{"operationId":"reschedule_psc_appointment_v3_order__order_id__psc_appointment_reschedule_patch","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":true,"reason":"rescheduling depends on live provider slot state; covered by the emulator-internal scheduling property suite instead"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppointmentRescheduleRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientFacingAppointment"}}}},"400":{"description":"Invalid or expired booking key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"404":{"description":"No appointment for this order","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v3/order/{order_id}/psc/appointment/cancel":{"parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","x-mockingbird-resource-ref":{"type":"order","missing":"00000000-0000-4000-8000-000000000000"}}}],"patch":{"operationId":"cancel_psc_appointment_v3_order__order_id__psc_appointment_cancel_patch","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":true,"reason":"cancellation depends on live provider appointment state; covered by the emulator-internal scheduling property suite instead"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PscAppointmentCancelRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientFacingAppointment"}}}},"400":{"description":"Invalid cancellation reason","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"404":{"description":"No appointment for this order","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v3/order/{order_id}":{"parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","x-mockingbird-resource-ref":{"type":"order","missing":"00000000-0000-4000-8000-000000000000"}}}],"get":{"operationId":"get_order_v3_order__order_id__get","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientFacingOrder"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v3/order/{order_id}/cancel":{"parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","x-mockingbird-resource-ref":{"type":"order","missing":"00000000-0000-4000-8000-000000000000"}}}],"post":{"operationId":"cancel_order_v3_order__order_id__cancel_post","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostOrderResponse"}}}},"400":{"description":"Order is not in a cancellable status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v3/order/{order_id}/test":{"parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","x-mockingbird-resource-ref":{"type":"order","missing":"00000000-0000-4000-8000-000000000000"}}}],"post":{"operationId":"simulate_order_v3_order__order_id__test_post","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"parameters":[{"name":"final_status","in":"query","required":true,"schema":{"type":"string","enum":["received.walk_in_test.ordered","received.walk_in_test.requisition_created","received.walk_in_test.requisition_bypassed","completed.walk_in_test.completed","sample_with_lab.walk_in_test.partial_results","failed.walk_in_test.sample_error","cancelled.walk_in_test.cancelled","collecting_sample.walk_in_test.appointment_pending","collecting_sample.walk_in_test.appointment_scheduled","collecting_sample.walk_in_test.appointment_cancelled","collecting_sample.walk_in_test.redraw_available","received.at_home_phlebotomy.ordered","received.at_home_phlebotomy.requisition_created","received.at_home_phlebotomy.requisition_bypassed","collecting_sample.at_home_phlebotomy.appointment_pending","collecting_sample.at_home_phlebotomy.appointment_scheduled","collecting_sample.at_home_phlebotomy.draw_completed","collecting_sample.at_home_phlebotomy.appointment_cancelled","completed.at_home_phlebotomy.completed","sample_with_lab.at_home_phlebotomy.partial_results","cancelled.at_home_phlebotomy.cancelled","failed.at_home_phlebotomy.sample_error","received.testkit.ordered","received.testkit.awaiting_registration","received.testkit.requisition_created","received.testkit.requisition_bypassed","received.testkit.registered","collecting_sample.testkit.transit_customer","collecting_sample.testkit.out_for_delivery","collecting_sample.testkit.with_customer","collecting_sample.testkit.transit_lab","sample_with_lab.testkit.delivered_to_lab","sample_with_lab.testkit.lab_processing_blocked","completed.testkit.completed","failed.testkit.failure_to_deliver_to_customer","failed.testkit.failure_to_deliver_to_lab","failed.testkit.sample_error","failed.testkit.lost","cancelled.testkit.cancelled","cancelled.testkit.do_not_process","collecting_sample.testkit.problem_in_transit_customer","collecting_sample.testkit.problem_in_transit_lab","received.on_site_collection.ordered","received.on_site_collection.requisition_created","received.on_site_collection.requisition_bypassed","sample_with_lab.on_site_collection.draw_completed","completed.on_site_collection.completed","cancelled.on_site_collection.cancelled","sample_with_lab.on_site_collection.partial_results","failed.on_site_collection.sample_error","completed.walk_in_test.corrected","completed.at_home_phlebotomy.corrected","completed.on_site_collection.corrected","completed.testkit.corrected"]}},{"name":"delay","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Seconds to defer the status transition"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulationFlags"}}}},"responses":{"200":{"description":"Successful Response","content":{"text/plain":{"schema":{"type":"string","examples":["Success"]}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"500":{"description":"Observed sandbox response for immediate completion of a cancelled testkit (PR 173, 2026-09-29)","content":{"text/plain":{"schema":{"type":"string","enum":["Internal Server Error"]}}}}}}},"/v3/order/{order_id}/result":{"parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","x-mockingbird-resource-ref":{"type":"order","missing":"00000000-0000-4000-8000-000000000000"}}}],"get":{"operationId":"get_result_raw_v3_order__order_id__result_get","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":true,"reason":"results carry provider-side specimen data; covered by the emulator-internal results property suite instead"}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LabResultsRaw"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v3/order/{order_id}/result/metadata":{"parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","x-mockingbird-resource-ref":{"type":"order","missing":"00000000-0000-4000-8000-000000000000"}}}],"get":{"operationId":"get_result_metadata_v3_order__order_id__result_metadata_get","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LabResultsMetadata"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v3/order/{order_id}/result/pdf":{"parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","x-mockingbird-resource-ref":{"type":"order","missing":"00000000-0000-4000-8000-000000000000"}}}],"get":{"operationId":"get_result_pdf_v3_order__order_id__result_pdf_get","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":true,"reason":"PDF bytes are provider-rendered; compared by shape (byteLength) only in the scenario script"}},"responses":{"200":{"description":"Successful Response","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v3/order/{order_id}/requisition/pdf":{"parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","x-mockingbird-resource-ref":{"type":"order","missing":"00000000-0000-4000-8000-000000000000"}}}],"get":{"operationId":"get_order_requisition_pdf_v3_order__order_id__requisition_pdf_get","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":true,"reason":"Synthetic PDF includes persisted selected provider account number or unknown; admin evidence override supported; live comparison remains shape-only"}},"responses":{"200":{"description":"Successful Response","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v3/orders":{"get":{"operationId":"get_orders_v3_orders_get","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"parameters":[{"name":"user_id","in":"query","required":true,"schema":{"type":"string","format":"uuid","x-mockingbird-resource-ref":{"type":"user","missing":"00000000-0000-4000-8000-000000000000"}}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1}},{"name":"size","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":50}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetOrdersResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v3/order_transaction/{transaction_id}":{"parameters":[{"name":"transaction_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","x-mockingbird-resource-ref":{"type":"order_transaction","missing":"00000000-0000-4000-8000-000000000000"}}}],"get":{"operationId":"get_order_transaction_v3_order_transaction__transaction_id__get","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":true,"reason":"order transactions are not available to the sandbox team (feature not available)"}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetOrderTransactionResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v3/order_transaction/{transaction_id}/result":{"parameters":[{"name":"transaction_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","x-mockingbird-resource-ref":{"type":"order_transaction","missing":"00000000-0000-4000-8000-000000000000"}}}],"get":{"operationId":"get_order_transaction_result_v3_order_transaction__transaction_id__result_get","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":true,"reason":"lab results are not available to the sandbox team (feature not available)"}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LabResultsRaw"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"securitySchemes":{"apiKeyAuth":{"type":"apiKey","in":"header","name":"x-vital-api-key"}},"schemas":{"UserCreateBody":{"type":"object","required":["client_user_id"],"properties":{"client_user_id":{"type":"string","minLength":1,"maxLength":64,"examples":["mbr_8891","patient-1042","user.profile_52"]},"fallback_time_zone":{"type":["string","null"],"enum":["America/Los_Angeles","America/New_York","Europe/London","UTC",null]}}},"ClientFacingUser":{"type":"object","required":["user_id","team_id","client_user_id","created_on","connected_sources","fallback_time_zone"],"properties":{"user_id":{"type":"string","format":"uuid","x-mockingbird-resource":{"type":"user","identity":true},"x-mockingbird-volatile":{"kind":"id"}},"team_id":{"type":"string","format":"uuid","x-mockingbird-volatile":{"kind":"account"}},"client_user_id":{"type":"string"},"created_on":{"type":"string","format":"date-time","x-mockingbird-volatile":{"kind":"timestamp"}},"connected_sources":{"type":"array","items":{"type":"object","additionalProperties":true}},"fallback_time_zone":{"type":["object","null"],"properties":{"id":{"type":"string"},"source_slug":{"type":"string"},"updated_at":{"type":"string","format":"date-time","x-mockingbird-volatile":{"kind":"timestamp"}}}},"fallback_birth_date":{"type":["object","null"],"properties":{"value":{"type":"string"},"source_slug":{"type":"string"},"updated_at":{"type":"string","format":"date-time","x-mockingbird-volatile":{"kind":"timestamp"}}}},"ingestion_start":{"type":["string","null"]},"ingestion_end":{"type":["string","null"]}}},"UserInfoPatchBody":{"type":"object","properties":{"first_name":{"type":["string","null"]},"last_name":{"type":["string","null"]},"dob":{"type":["string","null"]},"gender":{"type":["string","null"]},"phone_number":{"type":["string","null"]},"email":{"type":["string","null"]},"address":{"type":["object","null"],"additionalProperties":true}}},"UserInfo":{"type":"object","additionalProperties":true},"ClientUserIDConflictResponse":{"type":"object","required":["detail"],"properties":{"detail":{"type":"object","required":["error_type","error_message","user_id","created_on"],"properties":{"error_type":{"type":"string"},"error_message":{"type":"string"},"user_id":{"type":"string","format":"uuid","x-mockingbird-volatile":{"kind":"id"}},"created_on":{"type":"string","format":"date-time","x-mockingbird-volatile":{"kind":"timestamp"}}}}}},"UserSuccessResponse":{"type":"object","required":["success"],"properties":{"success":{"type":"boolean"}}},"PaginatedUsersResponse":{"type":"object","required":["users","total","offset","limit"],"properties":{"users":{"type":"array","items":{"$ref":"#/components/schemas/ClientFacingUser"}},"total":{"type":"integer"},"offset":{"type":"integer"},"limit":{"type":"integer"}}},"UserPatchBody":{"type":"object","properties":{"fallback_time_zone":{"type":["string","null"]},"fallback_birth_date":{"type":["string","null"],"format":"date"},"ingestion_start":{"type":["string","null"],"format":"date"},"ingestion_end":{"type":["string","null"],"format":"date"},"client_user_id":{"type":["string","null"]}}},"LabTestCollectionMethod":{"type":"string","enum":["testkit","walk_in_test","at_home_phlebotomy","on_site_collection"]},"LabTestGenerationMethodFilter":{"type":"string","enum":["auto","manual","all"]},"LabTestSampleType":{"type":"string","enum":["dried_blood_spot","arm_collector","serum","saliva","urine","stool"]},"LabTestStatus":{"type":"string","enum":["active","pending_approval","inactive"]},"MarkerType":{"type":"string","enum":["biomarker","panel"]},"ClientFacingLab":{"type":"object","required":["id","slug","name","first_line_address","city","zipcode","collection_methods","sample_types"],"properties":{"id":{"type":"integer","x-mockingbird-volatile":{"kind":"id"}},"slug":{"type":"string"},"name":{"type":"string"},"first_line_address":{"type":"string"},"city":{"type":"string"},"zipcode":{"type":"string"},"collection_methods":{"type":"array","items":{"$ref":"#/components/schemas/LabTestCollectionMethod"}},"sample_types":{"type":"array","items":{"$ref":"#/components/schemas/LabTestSampleType"}},"logo_url":{"type":["string","null"]}}},"ClientFacingMarker":{"type":"object","required":["id","name","slug"],"properties":{"id":{"type":"integer","x-mockingbird-volatile":{"kind":"id"}},"name":{"type":"string"},"slug":{"type":"string"},"description":{"type":["string","null"]},"lab_id":{"type":["integer","null"]},"provider_id":{"type":["string","null"]},"type":{"anyOf":[{"$ref":"#/components/schemas/MarkerType"},{"type":"null"}]},"unit":{"type":["string","null"]},"price":{"type":["string","null"]},"aoe":{"anyOf":[{"type":"object","additionalProperties":true},{"type":"null"}]},"a_la_carte_enabled":{"type":"boolean","default":false},"common_tat_days":{"type":["integer","null"]},"worst_case_tat_days":{"type":["integer","null"]},"is_orderable":{"type":["boolean","null"],"default":true}}},"ClientFacingLabTest":{"type":"object","required":["id","slug","name","sample_type","method","price","is_active","status","lab","markers"],"properties":{"id":{"type":"string","format":"uuid","x-mockingbird-resource":{"type":"lab_test","identity":true}},"slug":{"type":"string","x-mockingbird-volatile":{"kind":"token"}},"name":{"type":"string","x-mockingbird-volatile":{"kind":"token"}},"sample_type":{"$ref":"#/components/schemas/LabTestSampleType"},"method":{"$ref":"#/components/schemas/LabTestCollectionMethod"},"price":{"type":"number"},"is_active":{"type":"boolean"},"status":{"$ref":"#/components/schemas/LabTestStatus"},"fasting":{"type":"boolean","default":false},"lab":{"anyOf":[{"$ref":"#/components/schemas/ClientFacingLab"},{"type":"null"}]},"markers":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ClientFacingMarker"}},{"type":"null"}]},"is_delegated":{"type":"boolean","default":false},"auto_generated":{"type":"boolean","default":false},"has_collection_instructions":{"type":["boolean","null"]},"common_tat_days":{"type":["integer","null"]},"worst_case_tat_days":{"type":["integer","null"]}}},"LabTestResourcesResponse":{"type":"object","required":["data","next_cursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ClientFacingLabTest"}},"next_cursor":{"type":["string","null"]}}},"LabAccountStatus":{"type":"string","enum":["active","pending","suspended","ready_to_launch"]},"LabAccountDelegatedFlow":{"type":"string","enum":["order_delegated","result_delegated","fully_delegated","not_delegated"]},"USState":{"type":"string","enum":["AL","AK","AZ","AR","CA","CO","CT","DE","FL","GA","HI","ID","IL","IN","IA","KS","KY","LA","ME","MD","MA","MI","MN","MS","MO","MT","NE","NV","NH","NJ","NM","NY","NC","ND","OH","OK","OR","PA","RI","SC","SD","TN","TX","UT","VT","VA","WA","WV","WI","WY"]},"Labs":{"type":"string","enum":["ayumetrix","spiriplex","ussl","quest","sonora_quest","labcorp","bioreference","us_biotek","manual","sanocardio","ihd","nexus","my_uti","crl","mtl"]},"ClientFacingLabAccount":{"type":"object","required":["id","lab","status","delegated_flow","provider_account_id","allowed_billing","team_id_allowlist"],"properties":{"id":{"type":"string","format":"uuid","x-mockingbird-resource":{"type":"lab_account","identity":true}},"lab":{"$ref":"#/components/schemas/Labs"},"org_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"status":{"$ref":"#/components/schemas/LabAccountStatus"},"delegated_flow":{"$ref":"#/components/schemas/LabAccountDelegatedFlow"},"provider_account_id":{"type":"string"},"account_name":{"anyOf":[{"type":"string"},{"type":"null"}]},"default_clinical_notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"business_units":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"allowed_billing":{"type":"object","propertyNames":{"$ref":"#/components/schemas/Billing"},"additionalProperties":{"type":"array","items":{"$ref":"#/components/schemas/USState"}}},"team_id_allowlist":{"type":"array","items":{"type":"string","format":"uuid"}}}},"GetTeamLabAccountsResponse":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ClientFacingLabAccount"}}}},"ClientFacingResult":{"type":"object","required":["name","slug","type"],"properties":{"name":{"type":"string"},"slug":{"type":"string"},"provider_id":{"type":["string","null"]},"type":{"$ref":"#/components/schemas/ResultType"},"value":{"type":["number","null"]},"unit":{"type":["string","null"]},"low_value":{"type":["number","null"]},"high_value":{"type":["number","null"]},"string_value":{"type":["string","null"]},"coded_value":{"type":["string","null"]},"is_abnormal":{"type":"boolean","default":false},"notes":{"type":["string","null"]}}},"GetMarkersResponse":{"type":"object","required":["markers"],"properties":{"markers":{"type":"array","items":{"$ref":"#/components/schemas/ClientFacingMarkerComplete"}},"total":{"type":["integer","null"]},"page":{"type":["integer","null"]},"size":{"type":["integer","null"]},"pages":{"type":["integer","null"]}}},"ClientFacingExpectedResult":{"type":"object","required":["id","name","slug","required"],"properties":{"id":{"type":"integer","x-mockingbird-volatile":{"kind":"id"}},"name":{"type":"string"},"slug":{"type":"string"},"lab_id":{"type":["integer","null"]},"provider_id":{"type":["string","null"]},"required":{"type":"boolean"},"loinc":{"type":["object","null"],"required":["id","name","slug","code"],"properties":{"id":{"type":"integer","x-mockingbird-volatile":{"kind":"id"}},"name":{"type":"string"},"slug":{"type":"string"},"code":{"type":"string"},"unit":{"type":["string","null"]}}}}},"ClientFacingMarkerComplete":{"type":"object","required":["id","name","slug","expected_results"],"properties":{"id":{"type":"integer","x-mockingbird-volatile":{"kind":"id"}},"name":{"type":"string"},"slug":{"type":"string"},"description":{"type":["string","null"]},"lab_id":{"type":["integer","null"]},"provider_id":{"type":["string","null"]},"type":{"anyOf":[{"$ref":"#/components/schemas/MarkerType"},{"type":"null"}]},"unit":{"type":["string","null"]},"price":{"type":["string","null"]},"a_la_carte_enabled":{"type":"boolean","default":false},"common_tat_days":{"type":["integer","null"]},"worst_case_tat_days":{"type":["integer","null"]},"is_orderable":{"type":["boolean","null"],"default":true},"expected_results":{"type":"array","items":{"$ref":"#/components/schemas/ClientFacingExpectedResult"}}}},"ListOrderSetMarkersRequest":{"type":"object","required":["order_set_id"],"properties":{"order_set_id":{"type":"string","format":"uuid","x-mockingbird-resource-ref":{"type":"order_transaction","missing":"00000000-0000-4000-8000-000000000000"}},"provider_id":{"type":["string","null"]}}},"AllowedRadius":{"type":"integer","enum":[10,20,25,50,100]},"AppointmentPscLabs":{"type":"string","enum":["quest"]},"AppointmentProvider":{"type":"string","enum":["getlabs","phlebfinders","quest"]},"AppointmentType":{"type":"string","enum":["phlebotomy","patient_service_center"]},"AppointmentStatus":{"type":"string","enum":["confirmed","pending","reserved","in_progress","completed","cancelled"]},"AppointmentEventStatus":{"type":"string","enum":["pending","reserved","scheduled","completed","cancelled","in_progress"]},"AppointmentServiceType":{"type":"string","enum":["appointment-ready","appointment-request"]},"Billing":{"type":"string","enum":["client_bill","commercial_insurance","patient_bill_passthrough","patient_bill"]},"LabLocationCapability":{"type":"string","enum":["stat","appointment_scheduling_via_junction","appointment_scheduling_with_lab"]},"LngLat":{"type":"object","required":["lng","lat"],"properties":{"lng":{"type":"number"},"lat":{"type":"number"}}},"UsAddress":{"type":"object","required":["first_line","city","state","zip_code"],"properties":{"first_line":{"type":"string","minLength":1},"second_line":{"type":["string","null"]},"city":{"type":"string","minLength":1},"state":{"type":"string","minLength":1},"zip_code":{"type":"string","minLength":1},"unit":{"type":["string","null"]}}},"AppointmentLocation":{"type":"object","required":["location","address","code","name"],"properties":{"location":{"$ref":"#/components/schemas/LngLat"},"distance":{"type":["number","null"]},"address":{"$ref":"#/components/schemas/UsAddress"},"code":{"type":"string"},"name":{"type":"string"},"iana_timezone":{"type":["string","null"]}}},"TimeSlot":{"type":"object","required":["start","end","price","is_priority","num_appointments_available"],"properties":{"booking_key":{"type":["string","null"],"x-mockingbird-resource":{"type":"booking_key","identity":true},"x-mockingbird-volatile":{"kind":"token"}},"start":{"type":"string","format":"date-time","x-mockingbird-volatile":{"kind":"timestamp"}},"end":{"type":"string","format":"date-time","x-mockingbird-volatile":{"kind":"timestamp"}},"expires_at":{"type":["string","null"],"x-mockingbird-volatile":{"kind":"timestamp"}},"price":{"type":"number"},"is_priority":{"type":"boolean"},"num_appointments_available":{"type":"integer"}}},"DaySlots":{"type":"object","required":["date","slots"],"properties":{"location":{"anyOf":[{"$ref":"#/components/schemas/AppointmentLocation"},{"type":"null"}]},"date":{"type":"string","format":"date"},"slots":{"type":"array","items":{"$ref":"#/components/schemas/TimeSlot"}}}},"AppointmentAvailabilitySlots":{"type":"object","required":["slots"],"properties":{"slots":{"type":"array","items":{"$ref":"#/components/schemas/DaySlots"}},"timezone":{"type":["string","null"]}}},"AppointmentBookingRequest":{"type":"object","required":["booking_key"],"properties":{"booking_key":{"type":"string","minLength":1,"x-mockingbird-resource-ref":{"type":"booking_key"}}}},"AppointmentRescheduleRequest":{"type":"object","required":["booking_key"],"properties":{"booking_key":{"type":"string","minLength":1,"x-mockingbird-resource-ref":{"type":"booking_key"}}}},"PscAppointmentBookingRequest":{"type":"object","required":["booking_key","site_code"],"properties":{"booking_key":{"type":"string","minLength":1,"x-mockingbird-resource-ref":{"type":"booking_key"}},"site_code":{"type":"string","minLength":1}}},"PhlebotomyAppointmentCancelRequest":{"type":"object","required":["cancellation_reason_id"],"properties":{"cancellation_reason_id":{"type":"string","minLength":1},"notes":{"type":["string","null"]}}},"PscAppointmentCancelRequest":{"type":"object","required":["cancellationReasonId"],"properties":{"cancellationReasonId":{"type":"string","minLength":1},"note":{"type":["string","null"]}}},"ClientFacingAppointmentEvent":{"type":"object","required":["created_at","status"],"properties":{"created_at":{"type":"string","format":"date-time","x-mockingbird-volatile":{"kind":"timestamp"}},"status":{"$ref":"#/components/schemas/AppointmentEventStatus"},"data":{"anyOf":[{"type":"object","additionalProperties":true},{"type":"null"}]}}},"ClientFacingAppointment":{"type":"object","required":["id","user_id","order_id","address","location","type","provider","status","provider_id","can_reschedule","event_status","events"],"properties":{"id":{"type":"string","format":"uuid","x-mockingbird-resource":{"type":"appointment","identity":true},"x-mockingbird-volatile":{"kind":"id"}},"user_id":{"type":"string","format":"uuid","x-mockingbird-resource-ref":{"type":"user"}},"order_id":{"type":"string","format":"uuid","x-mockingbird-resource-ref":{"type":"order"}},"address":{"$ref":"#/components/schemas/UsAddress"},"location":{"$ref":"#/components/schemas/LngLat"},"start_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"x-mockingbird-volatile":{"kind":"timestamp"}},"end_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"x-mockingbird-volatile":{"kind":"timestamp"}},"iana_timezone":{"type":["string","null"]},"type":{"$ref":"#/components/schemas/AppointmentType"},"provider":{"$ref":"#/components/schemas/AppointmentProvider"},"status":{"$ref":"#/components/schemas/AppointmentStatus"},"provider_id":{"type":"string","x-mockingbird-volatile":{"kind":"id"}},"external_id":{"type":["string","null"],"x-mockingbird-volatile":{"kind":"id"}},"can_reschedule":{"type":"boolean"},"event_status":{"$ref":"#/components/schemas/AppointmentEventStatus"},"event_data":{"anyOf":[{"type":"object","additionalProperties":true},{"type":"null"}]},"order_transaction_id":{"type":["string","null"],"x-mockingbird-resource-ref":{"type":"order_transaction"}},"appointment_notes":{"type":["string","null"]},"events":{"type":"array","items":{"$ref":"#/components/schemas/ClientFacingAppointmentEvent"}}}},"ClientFacingAppointmentCancellationReason":{"type":"object","required":["id","name","is_refundable"],"properties":{"id":{"type":"string","x-mockingbird-volatile":{"kind":"id"}},"name":{"type":"string"},"is_refundable":{"type":"boolean"}}},"PhlebotomyAreaInfo":{"type":"object","required":["is_served","providers"],"properties":{"is_served":{"type":"boolean"},"providers":{"type":"array","items":{"$ref":"#/components/schemas/PhlebotomyProviderInfo"}}}},"PhlebotomyProviderInfo":{"type":"object","required":["name","service_types"],"properties":{"name":{"$ref":"#/components/schemas/AppointmentProvider"},"service_types":{"type":"array","items":{"$ref":"#/components/schemas/AppointmentServiceType"}}}},"PscAreaInfoDetails":{"type":"object","required":["appointment_with_vital","within_radius","radius"],"properties":{"appointment_with_vital":{"type":"boolean"},"within_radius":{"type":"number"},"radius":{"type":"string"},"capabilities":{"type":["array","null"],"items":{"$ref":"#/components/schemas/LabLocationCapability"}}}},"PscAreaInfo":{"type":"object","required":["patient_service_centers","supported_bill_types","lab_id"],"properties":{"patient_service_centers":{"$ref":"#/components/schemas/PscAreaInfoDetails"},"supported_bill_types":{"type":"array","items":{"$ref":"#/components/schemas/Billing"}},"lab_id":{"type":"integer"}}},"AreaInfo":{"type":"object","required":["zip_code","phlebotomy","central_labs"],"properties":{"zip_code":{"type":"string"},"phlebotomy":{"$ref":"#/components/schemas/PhlebotomyAreaInfo"},"central_labs":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/PscAreaInfo"}}}},"LabLocationMetadata":{"type":"object","required":["name","state","city","zip_code","first_line"],"properties":{"name":{"type":"string"},"state":{"type":"string"},"city":{"type":"string"},"zip_code":{"type":"string"},"first_line":{"type":"string"},"second_line":{"type":["string","null"]},"phone_number":{"type":["string","null"]},"fax_number":{"type":["string","null"]},"hours":{"type":["object","null"],"additionalProperties":true}}},"ClientFacingLabLocation":{"type":"object","required":["metadata","distance","site_code","supported_bill_types","location","capabilities"],"properties":{"metadata":{"$ref":"#/components/schemas/LabLocationMetadata"},"distance":{"type":"number"},"site_code":{"type":"string"},"supported_bill_types":{"type":"array","items":{"$ref":"#/components/schemas/Billing"}},"location":{"$ref":"#/components/schemas/LngLat"},"capabilities":{"type":"array","items":{"$ref":"#/components/schemas/LabLocationCapability"}}}},"PscInfo":{"type":"object","required":["lab_id","slug","patient_service_centers"],"properties":{"lab_id":{"type":"integer"},"slug":{"type":"string"},"patient_service_centers":{"type":"array","items":{"$ref":"#/components/schemas/ClientFacingLabLocation"}}}},"OrderTopLevelStatus":{"type":"string","enum":["received","collecting_sample","sample_with_lab","completed","cancelled","failed"]},"OrderLowLevelStatus":{"type":"string","enum":["ordered","requisition_created","requisition_bypassed","transit_customer","out_for_delivery","with_customer","transit_lab","delivered_to_lab","completed","failure_to_deliver_to_lab","failure_to_deliver_to_customer","problem_in_transit_lab","problem_in_transit_customer","sample_error","appointment_scheduled","appointment_cancelled","appointment_pending","draw_completed","cancelled","lost","do_not_process","partial_results","awaiting_registration","registered","redraw_available","corrected","lab_processing_blocked"]},"OrderStatus":{"type":"string","enum":["received.walk_in_test.ordered","received.walk_in_test.requisition_created","received.walk_in_test.requisition_bypassed","completed.walk_in_test.completed","sample_with_lab.walk_in_test.partial_results","failed.walk_in_test.sample_error","cancelled.walk_in_test.cancelled","collecting_sample.walk_in_test.appointment_pending","collecting_sample.walk_in_test.appointment_scheduled","collecting_sample.walk_in_test.appointment_cancelled","collecting_sample.walk_in_test.redraw_available","received.at_home_phlebotomy.ordered","received.at_home_phlebotomy.requisition_created","received.at_home_phlebotomy.requisition_bypassed","collecting_sample.at_home_phlebotomy.appointment_pending","collecting_sample.at_home_phlebotomy.appointment_scheduled","collecting_sample.at_home_phlebotomy.draw_completed","collecting_sample.at_home_phlebotomy.appointment_cancelled","completed.at_home_phlebotomy.completed","sample_with_lab.at_home_phlebotomy.partial_results","cancelled.at_home_phlebotomy.cancelled","failed.at_home_phlebotomy.sample_error","received.testkit.ordered","received.testkit.awaiting_registration","received.testkit.requisition_created","received.testkit.requisition_bypassed","received.testkit.registered","collecting_sample.testkit.transit_customer","collecting_sample.testkit.out_for_delivery","collecting_sample.testkit.with_customer","collecting_sample.testkit.transit_lab","sample_with_lab.testkit.delivered_to_lab","sample_with_lab.testkit.lab_processing_blocked","completed.testkit.completed","failed.testkit.failure_to_deliver_to_customer","failed.testkit.failure_to_deliver_to_lab","failed.testkit.sample_error","failed.testkit.lost","cancelled.testkit.cancelled","cancelled.testkit.do_not_process","collecting_sample.testkit.problem_in_transit_customer","collecting_sample.testkit.problem_in_transit_lab","received.on_site_collection.ordered","received.on_site_collection.requisition_created","received.on_site_collection.requisition_bypassed","sample_with_lab.on_site_collection.draw_completed","completed.on_site_collection.completed","cancelled.on_site_collection.cancelled","sample_with_lab.on_site_collection.partial_results","failed.on_site_collection.sample_error","completed.walk_in_test.corrected","completed.at_home_phlebotomy.corrected","completed.on_site_collection.corrected","completed.testkit.corrected"]},"OrderStatusDetail":{"type":"string","enum":["fulfillment_error","date_of_collection_unspecified","demographic_information_unspecified","demographic_information_mismatch","sample_quantity_not_sufficient","sample_contaminated","sample_stability_exceeded","sample_hemolyzed","sample_improper_collection"]},"OrderTransactionStatus":{"type":"string","enum":["active","completed","cancelled"]},"ClientFacingOrderEvent":{"type":"object","required":["id","created_at","status"],"properties":{"id":{"type":"integer","x-mockingbird-volatile":{"kind":"opaque"}},"created_at":{"type":"string","format":"date-time","x-mockingbird-volatile":{"kind":"timestamp"}},"status":{"$ref":"#/components/schemas/OrderStatus"},"status_detail":{"anyOf":[{"$ref":"#/components/schemas/OrderStatusDetail"},{"type":"null"}]}}},"ShippingAddress":{"type":"object","required":["receiver_name","first_line","city","state","zip","country","phone_number"],"properties":{"receiver_name":{"type":"string"},"first_line":{"type":"string"},"second_line":{"type":["string","null"]},"city":{"type":"string"},"state":{"type":"string"},"zip":{"type":"string"},"country":{"type":"string"},"phone_number":{"type":"string"}}},"ClientFacingPhysician":{"type":"object","required":["first_name","last_name","npi"],"properties":{"first_name":{"type":"string"},"last_name":{"type":"string"},"npi":{"type":"string"}}},"ClientFacingShipment":{"type":"object","required":["id","outbound_tracking_number","outbound_tracking_url","inbound_tracking_number","inbound_tracking_url","outbound_courier","inbound_courier","notes"],"properties":{"id":{"type":"string","format":"uuid","x-mockingbird-volatile":{"kind":"id"}},"outbound_tracking_number":{"type":["string","null"]},"outbound_tracking_url":{"type":["string","null"]},"inbound_tracking_number":{"type":["string","null"]},"inbound_tracking_url":{"type":["string","null"]},"outbound_courier":{"type":["string","null"]},"inbound_courier":{"type":["string","null"]},"notes":{"type":["string","null"]}}},"ClientFacingTestkitOrder":{"type":"object","required":["id","shipment","created_at","updated_at"],"properties":{"id":{"type":"string","format":"uuid","x-mockingbird-volatile":{"kind":"id"}},"shipment":{"anyOf":[{"$ref":"#/components/schemas/ClientFacingShipment"},{"type":"null"}],"x-mockingbird-volatile":{"kind":"opaque"}},"created_at":{"type":"string","format":"date-time","x-mockingbird-volatile":{"kind":"timestamp"}},"updated_at":{"type":"string","format":"date-time","x-mockingbird-volatile":{"kind":"timestamp"}}}},"ClientFacingWalkInOrder":{"type":"object","required":["id","appointment_id","created_at","updated_at"],"properties":{"id":{"type":"string","format":"uuid","x-mockingbird-volatile":{"kind":"id"}},"appointment_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","x-mockingbird-volatile":{"kind":"timestamp"}},"updated_at":{"type":"string","format":"date-time","x-mockingbird-volatile":{"kind":"timestamp"}}}},"ClientFacingTestKitOrderDetails":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["testkit","walk_in_test","at_home_phlebotomy","on_site_collection"]},"data":{"anyOf":[{"$ref":"#/components/schemas/ClientFacingTestkitOrder"},{"$ref":"#/components/schemas/ClientFacingWalkInOrder"},{"type":"null"}]}}},"ClientFacingPatientDetailsCompatible":{"type":"object","required":["first_name","last_name","dob","gender","phone_number","email"],"properties":{"first_name":{"type":"string","minLength":1,"pattern":"^[a-zA-Z0-9][a-zA-Z0-9 .,'-]*$","examples":["Ada","Chris","Maria","Jun"]},"last_name":{"type":"string","minLength":1,"pattern":"^[a-zA-Z0-9][a-zA-Z0-9 .,'-]*$","examples":["Lovelace","Vouga","Delgado","Park"]},"dob":{"type":"string","format":"date-time","examples":["1990-06-15T00:00:00.000Z","1983-02-02T00:00:00.000Z"]},"gender":{"type":"string","minLength":1,"pattern":"\\\\S","examples":["male","female","other","prefer_not_to_say"]},"phone_number":{"type":"string","minLength":1,"pattern":"^\\\\+1[2-9]\\\\d{9}$","examples":["+14155550123","+12125550987","+13105554444"]},"email":{"type":"string","format":"email","minLength":1,"examples":["ada@example.com","chris@example.com","maria@example.com"]}}},"PatientAddressCompatible":{"type":"object","required":["first_line","city","state","zip","country"],"properties":{"receiver_name":{"type":"string","default":"","examples":["Ada Lovelace","Chris Vouga"]},"first_line":{"type":"string","minLength":1,"pattern":"\\\\S","examples":["1 Main St","450 Market St","88 Kearny St"]},"second_line":{"type":["string","null"]},"city":{"type":"string","minLength":1,"pattern":"\\\\S","examples":["San Diego","San Francisco","New York"]},"state":{"type":"string","minLength":1,"enum":["AL","AK","AZ","AR","CA","CO","CT","DE","FL","GA","HI","ID","IL","IN","IA","KS","KY","LA","ME","MD","MA","MI","MN","MS","MO","MT","NE","NV","NH","NJ","NM","NY","NC","ND","OH","OK","OR","PA","RI","SC","SD","TN","TX","UT","VT","VA","WA","WV","WI","WY"]},"zip":{"type":"string","pattern":"^\\\\d{5}(-\\\\d{4})?$","examples":["92101","94105","10001"]},"country":{"type":"string","minLength":1,"pattern":"\\\\S","examples":["US"]},"access_notes":{"type":["string","null"],"examples":[null]},"phone_number":{"type":["string","null"],"examples":["+14155550123",null]}}},"AoeAnswerRequest":{"type":"object","required":["marker_id","question_id","answer"],"properties":{"marker_id":{"type":"integer","examples":[2075,1975]},"question_id":{"type":"integer","examples":[1]},"answer":{"type":"string","minLength":1,"examples":["No","Yes"]}}},"ClientFacingOrderInTransaction":{"type":"object","required":["id","created_at","updated_at"],"properties":{"id":{"type":"string","format":"uuid"},"low_level_status":{"anyOf":[{"$ref":"#/components/schemas/OrderLowLevelStatus"},{"type":"null"}]},"low_level_status_created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"x-mockingbird-volatile":{"kind":"timestamp"}},"created_at":{"type":"string","format":"date-time","x-mockingbird-volatile":{"kind":"timestamp"}},"updated_at":{"type":"string","format":"date-time","x-mockingbird-volatile":{"kind":"timestamp"}}}},"ClientFacingOrderTransaction":{"type":"object","required":["id","status","orders"],"properties":{"id":{"type":"string","format":"uuid","x-mockingbird-resource":{"type":"order_transaction","identity":true},"x-mockingbird-volatile":{"kind":"id"}},"status":{"$ref":"#/components/schemas/OrderTransactionStatus"},"orders":{"type":"array","items":{"$ref":"#/components/schemas/ClientFacingOrderInTransaction"}}}},"OrderSummary":{"type":"object","required":["id","last_status","last_status_created_at","updated_at","created_at"],"properties":{"id":{"type":"string","format":"uuid"},"origin":{"anyOf":[{"type":"string","enum":["initial","redraw","recreation"]},{"type":"null"}]},"parent_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"last_status":{"$ref":"#/components/schemas/OrderLowLevelStatus"},"last_status_created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"created_at":{"type":"string","format":"date-time"}}},"GetOrderTransactionResponse":{"type":"object","required":["id","team_id","status"],"properties":{"id":{"type":"string","format":"uuid","x-mockingbird-resource":{"type":"order_transaction","identity":true},"x-mockingbird-volatile":{"kind":"id"}},"team_id":{"type":"string","format":"uuid","x-mockingbird-volatile":{"kind":"account"}},"status":{"$ref":"#/components/schemas/OrderTransactionStatus"},"orders":{"type":"array","items":{"$ref":"#/components/schemas/OrderSummary"}}}},"ClientFacingOrder":{"type":"object","required":["user_id","id","team_id","patient_details","patient_address","lab_test","details","sample_id","notes","created_at","updated_at","events","last_event","health_insurance_id","requisition_form_url","shipping_details","has_abn"],"properties":{"user_id":{"type":"string","format":"uuid"},"id":{"type":"string","format":"uuid","x-mockingbird-resource":{"type":"order","identity":true},"x-mockingbird-volatile":{"kind":"id"}},"team_id":{"type":"string","format":"uuid","x-mockingbird-volatile":{"kind":"account"}},"patient_details":{"anyOf":[{"$ref":"#/components/schemas/ClientFacingPatientDetailsCompatible"},{"type":"null"}]},"patient_address":{"anyOf":[{"$ref":"#/components/schemas/PatientAddressCompatible"},{"type":"null"}]},"lab_test":{"$ref":"#/components/schemas/ClientFacingLabTest"},"details":{"$ref":"#/components/schemas/ClientFacingTestKitOrderDetails"},"sample_id":{"anyOf":[{"type":"string"},{"type":"null"}],"x-mockingbird-volatile":{"kind":"opaque"}},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"clinical_notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","x-mockingbird-volatile":{"kind":"timestamp"}},"updated_at":{"type":"string","format":"date-time","x-mockingbird-volatile":{"kind":"timestamp"}},"events":{"type":"array","items":{"$ref":"#/components/schemas/ClientFacingOrderEvent"}},"status":{"anyOf":[{"$ref":"#/components/schemas/OrderTopLevelStatus"},{"type":"null"}],"x-mockingbird-volatile":{"kind":"opaque"}},"last_event":{"$ref":"#/components/schemas/ClientFacingOrderEvent"},"physician":{"anyOf":[{"$ref":"#/components/schemas/ClientFacingPhysician"},{"type":"null"}]},"health_insurance_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"requisition_form_url":{"anyOf":[{"type":"string"},{"type":"null"}],"x-mockingbird-volatile":{"kind":"url"}},"priority":{"type":"boolean","default":false},"shipping_details":{"anyOf":[{"$ref":"#/components/schemas/ShippingAddress"},{"type":"null"}]},"activate_by":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}]},"passthrough":{"anyOf":[{"type":"string"},{"type":"null"}]},"billing_type":{"type":"string","enum":["client_bill","commercial_insurance","patient_bill_passthrough","patient_bill","upfront_payment"],"default":"client_bill"},"icd_codes":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"has_abn":{"type":"boolean"},"interpretation":{"anyOf":[{"type":"string","enum":["normal","abnormal","critical","unknown"]},{"type":"null"}]},"has_missing_results":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"expected_result_by_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}]},"worst_case_result_by_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}]},"origin":{"anyOf":[{"type":"string","enum":["initial","redraw","recreation"]},{"type":"null"}]},"order_transaction":{"anyOf":[{"$ref":"#/components/schemas/ClientFacingOrderTransaction"},{"type":"null"}]}}},"OrderSetRequest":{"type":"object","required":["lab_test_ids"],"properties":{"lab_test_ids":{"type":"array","minItems":1,"items":{"type":"string","format":"uuid","x-mockingbird-resource-ref":{"type":"lab_test","missing":"00000000-0000-4000-8000-000000000000"}}}}},"CreateOrderRequest":{"type":"object","required":["user_id","patient_details","patient_address","order_set"],"properties":{"user_id":{"type":"string","format":"uuid","x-mockingbird-resource-ref":{"type":"user","missing":"00000000-0000-4000-8000-000000000000"}},"patient_details":{"$ref":"#/components/schemas/ClientFacingPatientDetailsCompatible"},"patient_address":{"$ref":"#/components/schemas/PatientAddressCompatible"},"order_set":{"$ref":"#/components/schemas/OrderSetRequest"},"clinical_notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"passthrough":{"anyOf":[{"type":"string"},{"type":"null"}]},"collection_method":{"$ref":"#/components/schemas/LabTestCollectionMethod"},"lab_account_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"idempotency_key":{"type":["string","null"]},"idempotency_error":{"type":["string","null"]},"aoe_answers":{"type":["array","null"],"items":{"$ref":"#/components/schemas/AoeAnswerRequest"}}}},"PostOrderResponse":{"type":"object","required":["order","status","message"],"properties":{"order":{"$ref":"#/components/schemas/ClientFacingOrder"},"status":{"type":"string"},"message":{"type":"string"}}},"ResultType":{"type":"string","enum":["numeric","range","comment","coded_value"]},"ParentBiomarkerData":{"type":"object","required":["marker_id","name","slug"],"properties":{"marker_id":{"type":"integer"},"name":{"type":"string"},"slug":{"type":"string"},"provider_id":{"type":["string","null"]}}},"BiomarkerResult":{"type":"object","required":["name","result","type"],"properties":{"name":{"type":"string"},"slug":{"type":"string","default":""},"value":{"anyOf":[{"type":"number"},{"type":"null"}]},"result":{"type":"string"},"type":{"$ref":"#/components/schemas/ResultType"},"unit":{"type":["string","null"]},"timestamp":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"x-mockingbird-volatile":{"kind":"timestamp"}},"notes":{"type":["string","null"]},"reference_range":{"type":["string","null"]},"min_range_value":{"type":["number","null"]},"max_range_value":{"type":["number","null"]},"is_above_max_range":{"type":["boolean","null"]},"is_below_min_range":{"type":["boolean","null"]},"interpretation":{"type":"string","default":"normal"},"source_interpretation":{"type":"string","default":""},"loinc":{"type":["string","null"]},"loinc_slug":{"type":["string","null"]},"provider_id":{"type":["string","null"]},"source_markers":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ParentBiomarkerData"}},{"type":"null"}]},"performing_laboratory":{"type":["string","null"]},"source_sample_id":{"type":["string","null"]}}},"FailureType":{"type":"string","enum":["quantity_not_sufficient_failure","collection_process_failure","drop_off_failure","internal_lab_failure","order_entry_failure","non_failure","unknown_failure","patient_condition_failure","missing_result_calc_failure","missing_demo_aoe_calc_failure","insufficient_volume"]},"MissingBiomarkerResult":{"type":"object","required":["name","slug","inferred_failure_type"],"properties":{"name":{"type":"string"},"slug":{"type":"string"},"inferred_failure_type":{"$ref":"#/components/schemas/FailureType"},"note":{"type":["string","null"]},"loinc":{"type":["string","null"]},"loinc_slug":{"type":["string","null"]},"provider_id":{"type":["string","null"]},"source_markers":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ParentBiomarkerData"}},{"type":"null"}]}}},"SampleData":{"type":"object","properties":{"sample_id":{"type":["string","null"]},"control_number":{"type":["string","null"]},"date_collected":{"type":["string","null"]},"date_received":{"type":["string","null"]},"date_reported":{"type":["string","null"]},"performing_laboratories":{"anyOf":[{"type":"object","additionalProperties":true},{"type":"null"}]},"clinical_information":{"anyOf":[{"type":"object","additionalProperties":true},{"type":"null"}]}}},"LabResultsMetadata":{"type":"object","required":["age","dob","patient","date_reported","specimen_number"],"properties":{"age":{"type":"string","x-mockingbird-volatile":{"kind":"token"}},"dob":{"type":"string","x-mockingbird-volatile":{"kind":"token"}},"clia_#":{"anyOf":[{"type":"string"},{"type":"null"}]},"patient":{"type":"string","x-mockingbird-volatile":{"kind":"token"}},"provider":{"anyOf":[{"type":"string"},{"type":"null"}],"x-mockingbird-volatile":{"kind":"token"}},"laboratory":{"anyOf":[{"type":"string"},{"type":"null"}],"x-mockingbird-volatile":{"kind":"token"}},"date_reported":{"type":"string","x-mockingbird-volatile":{"kind":"timestamp"}},"date_collected":{"anyOf":[{"type":"string"},{"type":"null"}],"x-mockingbird-volatile":{"kind":"timestamp"}},"specimen_number":{"type":"string","x-mockingbird-volatile":{"kind":"id"}},"date_received":{"anyOf":[{"type":"string"},{"type":"null"}],"x-mockingbird-volatile":{"kind":"timestamp"}},"status":{"type":"string","default":"final"},"interpretation":{"anyOf":[{"type":"string"},{"type":"null"}]},"patient_id":{"anyOf":[{"type":"string"},{"type":"null"}],"x-mockingbird-volatile":{"kind":"id"}},"account_id":{"anyOf":[{"type":"string"},{"type":"null"}],"x-mockingbird-volatile":{"kind":"id"}}}},"LabResultsRaw":{"type":"object","required":["metadata","results"],"properties":{"metadata":{"$ref":"#/components/schemas/LabResultsMetadata"},"results":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/BiomarkerResult"}},{"type":"object","additionalProperties":true}],"x-mockingbird-volatile":{"kind":"opaque"}},"missing_results":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/MissingBiomarkerResult"}},{"type":"null"}],"x-mockingbird-volatile":{"kind":"opaque"}},"sample_information":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/SampleData"}},{"type":"null"}],"x-mockingbird-volatile":{"kind":"opaque"}},"order_transaction":{"anyOf":[{"$ref":"#/components/schemas/ClientFacingOrderTransaction"},{"type":"null"}]}}},"SimulationFlags":{"type":"object","properties":{"interpretation":{"anyOf":[{"type":"string","enum":["normal","abnormal","critical","unknown"]},{"type":"null"}]},"result_types":{"type":"array","items":{"$ref":"#/components/schemas/ResultType"}},"has_missing_results":{"type":"boolean"}}},"GetOrdersResponse":{"type":"object","required":["orders"],"properties":{"orders":{"type":"array","items":{"$ref":"#/components/schemas/ClientFacingOrder"}},"total":{"anyOf":[{"type":"integer"},{"type":"null"}]},"page":{"anyOf":[{"type":"integer"},{"type":"null"}]},"size":{"anyOf":[{"type":"integer"},{"type":"null"}]}}},"HTTPValidationError":{"type":"object","properties":{"detail":{"title":"Detail"}}}}}}`);
10104
+ var document = JSON.parse(`{"openapi":"3.1.0","info":{"title":"Junction API (Mockingbird subset)","description":"Stateful emulator subset of the Junction (Vital) API.\\nDocs: https://docs.junction.com/\\nAuth: https://docs.junction.com/api-details/junction-api\\nCreate user: https://docs.junction.com/api-reference/user/create-user\\nGet user: https://docs.junction.com/api-reference/user/get-user\\nDelete user: https://docs.junction.com/api-reference/user/delete-user\\nResolve user: https://docs.junction.com/api-reference/user/resolve-user\\nUpdate user: https://docs.junction.com/api-reference/user/patch-user\\nGet users: https://docs.junction.com/api-reference/user/get-users\\nCreate order: https://docs.junction.com/api-reference/lab-testing/create-order\\nGet order: https://docs.junction.com/api-reference/lab-testing/get-order\\nGet orders: https://docs.junction.com/api-reference/lab-testing/get-orders\\nGet order transaction: https://docs.junction.com/api-reference/lab-testing/order-transactions/get-order-transaction\\nGet order transaction result: https://docs.junction.com/api-reference/lab-testing/results/get-order-transaction-results\\nLab tests: https://docs.junction.com/api-reference/lab-testing/tests-paginated\\nLab tests (deprecated, unpaged): https://docs.junction.com/api-reference/lab-testing/tests/get-lab-tests\\nAppointment availability: https://docs.junction.com/api-reference/lab-testing/appointments/get-appointment-availability\\nBook appointment: https://docs.junction.com/api-reference/lab-testing/appointments/book-appointment\\nGet appointment: https://docs.junction.com/api-reference/lab-testing/appointments/get-appointment\\nReschedule appointment: https://docs.junction.com/api-reference/lab-testing/appointments/reschedule-appointment\\nCancel appointment: https://docs.junction.com/api-reference/lab-testing/appointments/cancel-appointment\\nAppointment cancellation reasons: https://docs.junction.com/api-reference/lab-testing/appointments/get-appointment-cancellation-reasons\\nArea info: https://docs.junction.com/api-reference/lab-testing/service-areas/get-area-info\\nPSC info: https://docs.junction.com/api-reference/lab-testing/service-areas/get-psc-info\\nLab locations: https://docs.junction.com/api-reference/lab-testing/service-areas/get-lab-locations\\nRaw results: https://docs.junction.com/api-reference/lab-testing/results/get-lab-results\\nResult metadata: https://docs.junction.com/api-reference/lab-testing/results/get-lab-results-metadata\\nResult PDF: https://docs.junction.com/api-reference/lab-testing/results/get-lab-result-pdf\\nRequisition form PDF: https://docs.junction.com/api-reference/lab-testing/orders/get-requisition-form\\nList labs: https://docs.junction.com/api-reference/lab-testing/tests/get-labs\\nTest markers: https://docs.junction.com/api-reference/lab-testing/tests/get-markers-for-lab-test\\nOrder-set markers: https://docs.junction.com/api-reference/lab-testing/results/get-order-set-markers\\nLatest user info: https://docs.junction.com/api-reference/user/get-latest-user-info\\n","version":"0.4.758","x-mockingbird-upstream":{"docs":"https://docs.junction.com/","note":"Hand-authored subset from Junction public OpenAPI snippets in the docs."}},"servers":[{"url":"https://api.sandbox.us.junction.com"}],"security":[{"apiKeyAuth":[]}],"paths":{"/v2/user":{"post":{"operationId":"create_user_v2_user_post","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserCreateBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientFacingUser"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientUserIDConflictResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"operationId":"get_teams_users_v2_user_get","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"parameters":[{"name":"offset","in":"query","required":false,"schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedUsersResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"500":{"description":"Internal Server Error","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/v2/user/{user_id}":{"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","x-mockingbird-resource-ref":{"type":"user","missing":"00000000-0000-4000-8000-000000000000"}}}],"get":{"operationId":"get_user_v2_user__user_id__get","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientFacingUser"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"operationId":"delete_user_v2_user__user_id__delete","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserSuccessResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"operationId":"patch_user_v2_user__user_id__patch","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserPatchBody"}}}},"responses":{"204":{"description":"Successful Response"},"400":{"description":"Nothing to patch","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/user/resolve/{client_user_id}":{"parameters":[{"name":"client_user_id","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"get":{"operationId":"get_user_by_client_user_id_v2_user_resolve__client_user_id__get","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ClientFacingUser"},{"$ref":"#/components/schemas/PaginatedUsersResponse"}]}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/user/{user_id}/info":{"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","x-mockingbird-resource-ref":{"type":"user","missing":"00000000-0000-4000-8000-000000000000"}}}],"patch":{"operationId":"patch_user_info_v2_user__user_id__info_patch","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserInfoPatchBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserInfo"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/user/{user_id}/info/latest":{"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","x-mockingbird-resource-ref":{"type":"user","missing":"00000000-0000-4000-8000-000000000000"}}}],"get":{"operationId":"get_latest_user_info_user_v2_user__user_id__info_latest_get","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserInfo"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v3/lab_test":{"get":{"operationId":"get_paginated_lab_tests_for_team_v3_lab_test_get","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LabTestResourcesResponse"}}}}}}},"/v3/lab_test/lab_account":{"get":{"operationId":"get_team_lab_accounts_v3_lab_test_lab_account_get","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":true,"reason":"lab-account inventory is fixture-owned; the emulator models the documented shape, filters and routing rules, not a live account inventory"}},"parameters":[{"name":"lab_account_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/LabAccountStatus"},{"type":"null"}]}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetTeamLabAccountsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v3/lab_tests":{"get":{"operationId":"get_lab_tests_for_team_v3_lab_tests_get","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"summary":"Get Lab Tests For Team","description":"GET all the lab tests the team has access to.","deprecated":true,"parameters":[{"name":"generation_method","in":"query","required":false,"schema":{"$ref":"#/components/schemas/LabTestGenerationMethodFilter","description":"Filter on whether auto-generated lab tests created by Vital, manually created lab tests, or all lab tests should be returned.","default":"manual"},"description":"Filter on whether auto-generated lab tests created by Vital, manually created lab tests, or all lab tests should be returned."},{"name":"lab_slug","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by the slug of the lab for these lab tests.","title":"Lab Slug"},"description":"Filter by the slug of the lab for these lab tests."},{"name":"collection_method","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/LabTestCollectionMethod"},{"type":"null"}],"description":"Filter by the collection method for these lab tests.","title":"Collection Method"},"description":"Filter by the collection method for these lab tests."},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/LabTestStatus"},{"type":"null"}],"description":"Filter by the status of these lab tests.","title":"Status"},"description":"Filter by the status of these lab tests."},{"name":"marker_ids","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"integer"}},{"type":"null"}],"description":"Filter to only include lab tests containing these marker IDs.","title":"Marker Ids"},"description":"Filter to only include lab tests containing these marker IDs."},{"name":"provider_ids","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Filter to only include lab tests containing these provider IDs.","title":"Provider Ids"},"description":"Filter to only include lab tests containing these provider IDs."},{"name":"name","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by the name of the lab test (a case-insensitive substring search).","title":"Name"},"description":"Filter by the name of the lab test (a case-insensitive substring search)."},{"name":"order_key","in":"query","required":false,"schema":{"anyOf":[{"enum":["price","created_at","updated_at"],"type":"string"},{"type":"null"}],"title":"Order Key"}},{"name":"order_direction","in":"query","required":false,"schema":{"enum":["asc","desc"],"type":"string","default":"asc","title":"Order Direction"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ClientFacingLabTest"},"title":"Response Get Lab Tests For Team V3 Lab Tests Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v3/lab_tests/{lab_test_id}":{"parameters":[{"name":"lab_test_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","x-mockingbird-resource-ref":{"type":"lab_test","missing":"00000000-0000-4000-8000-000000000000"}}}],"get":{"operationId":"get_lab_test_for_team_v3_lab_tests__lab_test_id__get","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientFacingLabTest"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v3/lab_tests/labs":{"get":{"operationId":"get_labs_v3_lab_tests_labs_get","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ClientFacingLab"}}}}}}}},"/v3/lab_tests/{lab_test_id}/markers":{"parameters":[{"name":"lab_test_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","x-mockingbird-resource-ref":{"type":"lab_test","missing":"00000000-0000-4000-8000-000000000000"}}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1}},{"name":"size","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"provider_id","in":"query","required":false,"schema":{"type":"string"}}],"get":{"operationId":"get_markers_for_lab_test_v3_lab_tests__lab_test_id__markers_get","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetMarkersResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v3/lab_tests/list_order_set_markers":{"post":{"operationId":"list_order_set_markers_v3_lab_tests_list_order_set_markers_post","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListOrderSetMarkersRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetMarkersResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v3/order":{"post":{"operationId":"create_order_v3_order_post","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true,"reason":"Native profile parity only; explicit account profiles add fixture-owned billing policies and custom-marker orders, without production parity certification."}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrderRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostOrderResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"500":{"description":"Internal Server Error"}}}},"/v3/order/area/info":{"get":{"operationId":"get_area_info_v3_order_area_info_get","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":true,"reason":"central_labs presence, within_radius counts and getlabs market coverage are provider-owned geo data that an emulator cannot replicate per-zip; covered by the client-parity scenario shape checks instead"}},"parameters":[{"name":"zip_code","in":"query","required":true,"schema":{"type":"string","pattern":"^\\\\d{5}(?:-?\\\\d{4})?$"}},{"name":"radius","in":"query","required":false,"schema":{"$ref":"#/components/schemas/AllowedRadius"}},{"name":"lab_account_id","in":"query","required":false,"description":"Lab Account ID to use for availability checks","schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AreaInfo"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v3/order/psc/info":{"get":{"operationId":"get_psc_info_v3_order_psc_info_get","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":true,"reason":"patient_service_centers are real site inventories per zip (thousands of sites, result-capped at 30) that a fixture emulator cannot replicate per-zip; covered by the client-parity scenario shape checks instead"}},"parameters":[{"name":"zip_code","in":"query","required":true,"schema":{"type":"string","pattern":"^\\\\d{5}$"}},{"name":"lab_id","in":"query","required":true,"schema":{"type":"integer"}},{"name":"radius","in":"query","required":false,"schema":{"$ref":"#/components/schemas/AllowedRadius"}},{"name":"capabilities","in":"query","required":false,"schema":{"type":"array","items":{"$ref":"#/components/schemas/LabLocationCapability"}}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PscInfo"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v3/order/phlebotomy/appointment/availability":{"post":{"operationId":"get_phlebotomy_appointment_availability_v3_order_phlebotomy_appointment_availability_post","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":true,"reason":"availability slots are provider-side data whose values shift between sandbox calls; covered by the emulator-internal scheduling property suite instead"}},"parameters":[{"name":"start_date","in":"query","required":false,"schema":{"type":"string","format":"date"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsAddress"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppointmentAvailabilitySlots"}}}},"400":{"description":"Availability not bookable for this address","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"404":{"description":"No availability found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v3/order/phlebotomy/appointment/cancellation-reasons":{"get":{"operationId":"get_phlebotomy_appointment_cancellation_reason_v3_order_phlebotomy_appointment_cancellation_reasons_get","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ClientFacingAppointmentCancellationReason"}}}}}}}},"/v3/order/psc/appointment/availability":{"post":{"operationId":"get_psc_appointment_availability_v3_order_psc_appointment_availability_post","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":true,"reason":"availability slots are provider-side data whose values shift between sandbox calls; covered by the emulator-internal scheduling property suite instead"}},"parameters":[{"name":"lab","in":"query","required":true,"schema":{"$ref":"#/components/schemas/AppointmentPscLabs"}},{"name":"start_date","in":"query","required":false,"schema":{"type":"string","format":"date"}},{"name":"site_codes","in":"query","required":false,"schema":{"type":"string","description":"JSON-encoded array of site codes"}},{"name":"zip_code","in":"query","required":false,"schema":{"type":"string"}},{"name":"radius","in":"query","required":false,"schema":{"$ref":"#/components/schemas/AllowedRadius"}},{"name":"allow_stale","in":"query","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppointmentAvailabilitySlots"}}}},"400":{"description":"Availability not bookable for this address","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"404":{"description":"No slots found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v3/order/psc/appointment/cancellation-reasons":{"get":{"operationId":"get_psc_appointment_cancellation_reason_v3_order_psc_appointment_cancellation_reasons_get","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ClientFacingAppointmentCancellationReason"}}}}}}}},"/v3/order/{order_id}/phlebotomy/appointment":{"parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","x-mockingbird-resource-ref":{"type":"order","missing":"00000000-0000-4000-8000-000000000000"}}}],"get":{"operationId":"get_phlebotomy_appointment_v3_order__order_id__phlebotomy_appointment_get","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":true,"reason":"appointment payloads embed provider-side slot data; covered by the emulator-internal scheduling property suite instead"}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientFacingAppointment"}}}},"404":{"description":"No appointment for this order","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v3/order/{order_id}/phlebotomy/appointment/book":{"parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","x-mockingbird-resource-ref":{"type":"order","missing":"00000000-0000-4000-8000-000000000000"}}}],"post":{"operationId":"book_phlebotomy_appointment_v3_order__order_id__phlebotomy_appointment_book_post","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":true,"reason":"booking depends on live provider slot state; covered by the emulator-internal scheduling property suite instead"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppointmentBookingRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientFacingAppointment"}}}},"400":{"description":"Booking failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"404":{"description":"Order not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v3/order/{order_id}/phlebotomy/appointment/reschedule":{"parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","x-mockingbird-resource-ref":{"type":"order","missing":"00000000-0000-4000-8000-000000000000"}}}],"patch":{"operationId":"reschedule_phlebotomy_appointment_v3_order__order_id__phlebotomy_appointment_reschedule_patch","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":true,"reason":"rescheduling depends on live provider slot state; covered by the emulator-internal scheduling property suite instead"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppointmentRescheduleRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientFacingAppointment"}}}},"400":{"description":"Invalid or expired booking key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"404":{"description":"No appointment for this order","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v3/order/{order_id}/phlebotomy/appointment/cancel":{"parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","x-mockingbird-resource-ref":{"type":"order","missing":"00000000-0000-4000-8000-000000000000"}}}],"patch":{"operationId":"cancel_phlebotomy_appointment_v3_order__order_id__phlebotomy_appointment_cancel_patch","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":true,"reason":"cancellation depends on live provider appointment state; covered by the emulator-internal scheduling property suite instead"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PhlebotomyAppointmentCancelRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientFacingAppointment"}}}},"400":{"description":"Invalid cancellation reason","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"404":{"description":"No appointment for this order","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v3/order/{order_id}/psc/appointment":{"parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","x-mockingbird-resource-ref":{"type":"order","missing":"00000000-0000-4000-8000-000000000000"}}}],"get":{"operationId":"get_psc_appointment_v3_order__order_id__psc_appointment_get","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":true,"reason":"appointment payloads embed provider-side slot data; covered by the emulator-internal scheduling property suite instead"}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientFacingAppointment"}}}},"404":{"description":"No appointment for this order","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v3/order/{order_id}/psc/appointment/book":{"parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","x-mockingbird-resource-ref":{"type":"order","missing":"00000000-0000-4000-8000-000000000000"}}}],"post":{"operationId":"book_psc_appointment_v3_order__order_id__psc_appointment_book_post","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":true,"reason":"booking depends on live provider slot state; covered by the emulator-internal scheduling property suite instead"}},"parameters":[{"name":"x-idempotency-key","in":"header","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PscAppointmentBookingRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientFacingAppointment"}}}},"400":{"description":"Booking failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"404":{"description":"Order not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v3/order/{order_id}/psc/appointment/reschedule":{"parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","x-mockingbird-resource-ref":{"type":"order","missing":"00000000-0000-4000-8000-000000000000"}}}],"patch":{"operationId":"reschedule_psc_appointment_v3_order__order_id__psc_appointment_reschedule_patch","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":true,"reason":"rescheduling depends on live provider slot state; covered by the emulator-internal scheduling property suite instead"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppointmentRescheduleRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientFacingAppointment"}}}},"400":{"description":"Invalid or expired booking key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"404":{"description":"No appointment for this order","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v3/order/{order_id}/psc/appointment/cancel":{"parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","x-mockingbird-resource-ref":{"type":"order","missing":"00000000-0000-4000-8000-000000000000"}}}],"patch":{"operationId":"cancel_psc_appointment_v3_order__order_id__psc_appointment_cancel_patch","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":true,"reason":"cancellation depends on live provider appointment state; covered by the emulator-internal scheduling property suite instead"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PscAppointmentCancelRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientFacingAppointment"}}}},"400":{"description":"Invalid cancellation reason","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"404":{"description":"No appointment for this order","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v3/order/{order_id}":{"parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","x-mockingbird-resource-ref":{"type":"order","missing":"00000000-0000-4000-8000-000000000000"}}}],"get":{"operationId":"get_order_v3_order__order_id__get","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientFacingOrder"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v3/order/{order_id}/cancel":{"parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","x-mockingbird-resource-ref":{"type":"order","missing":"00000000-0000-4000-8000-000000000000"}}}],"post":{"operationId":"cancel_order_v3_order__order_id__cancel_post","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostOrderResponse"}}}},"400":{"description":"Order is not in a cancellable status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v3/order/{order_id}/test":{"parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","x-mockingbird-resource-ref":{"type":"order","missing":"00000000-0000-4000-8000-000000000000"}}}],"post":{"operationId":"simulate_order_v3_order__order_id__test_post","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"parameters":[{"name":"final_status","in":"query","required":true,"schema":{"type":"string","enum":["received.walk_in_test.ordered","received.walk_in_test.requisition_created","received.walk_in_test.requisition_bypassed","completed.walk_in_test.completed","sample_with_lab.walk_in_test.partial_results","failed.walk_in_test.sample_error","cancelled.walk_in_test.cancelled","collecting_sample.walk_in_test.appointment_pending","collecting_sample.walk_in_test.appointment_scheduled","collecting_sample.walk_in_test.appointment_cancelled","collecting_sample.walk_in_test.redraw_available","received.at_home_phlebotomy.ordered","received.at_home_phlebotomy.requisition_created","received.at_home_phlebotomy.requisition_bypassed","collecting_sample.at_home_phlebotomy.appointment_pending","collecting_sample.at_home_phlebotomy.appointment_scheduled","collecting_sample.at_home_phlebotomy.draw_completed","collecting_sample.at_home_phlebotomy.appointment_cancelled","completed.at_home_phlebotomy.completed","sample_with_lab.at_home_phlebotomy.partial_results","cancelled.at_home_phlebotomy.cancelled","failed.at_home_phlebotomy.sample_error","received.testkit.ordered","received.testkit.awaiting_registration","received.testkit.requisition_created","received.testkit.requisition_bypassed","received.testkit.registered","collecting_sample.testkit.transit_customer","collecting_sample.testkit.out_for_delivery","collecting_sample.testkit.with_customer","collecting_sample.testkit.transit_lab","sample_with_lab.testkit.delivered_to_lab","sample_with_lab.testkit.lab_processing_blocked","completed.testkit.completed","failed.testkit.failure_to_deliver_to_customer","failed.testkit.failure_to_deliver_to_lab","failed.testkit.sample_error","failed.testkit.lost","cancelled.testkit.cancelled","cancelled.testkit.do_not_process","collecting_sample.testkit.problem_in_transit_customer","collecting_sample.testkit.problem_in_transit_lab","received.on_site_collection.ordered","received.on_site_collection.requisition_created","received.on_site_collection.requisition_bypassed","sample_with_lab.on_site_collection.draw_completed","completed.on_site_collection.completed","cancelled.on_site_collection.cancelled","sample_with_lab.on_site_collection.partial_results","failed.on_site_collection.sample_error","completed.walk_in_test.corrected","completed.at_home_phlebotomy.corrected","completed.on_site_collection.corrected","completed.testkit.corrected"]}},{"name":"delay","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Seconds to defer the status transition"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulationFlags"}}}},"responses":{"200":{"description":"Successful Response","content":{"text/plain":{"schema":{"type":"string","examples":["Success"]}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"500":{"description":"Observed sandbox response for immediate completion of a cancelled testkit (PR 173, 2026-09-29)","content":{"text/plain":{"schema":{"type":"string","enum":["Internal Server Error"]}}}}}}},"/v3/order/{order_id}/result":{"parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","x-mockingbird-resource-ref":{"type":"order","missing":"00000000-0000-4000-8000-000000000000"}}}],"get":{"operationId":"get_result_raw_v3_order__order_id__result_get","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":true,"reason":"results carry provider-side specimen data; covered by the emulator-internal results property suite instead"}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LabResultsRaw"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v3/order/{order_id}/result/metadata":{"parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","x-mockingbird-resource-ref":{"type":"order","missing":"00000000-0000-4000-8000-000000000000"}}}],"get":{"operationId":"get_result_metadata_v3_order__order_id__result_metadata_get","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LabResultsMetadata"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v3/order/{order_id}/result/pdf":{"parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","x-mockingbird-resource-ref":{"type":"order","missing":"00000000-0000-4000-8000-000000000000"}}}],"get":{"operationId":"get_result_pdf_v3_order__order_id__result_pdf_get","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":true,"reason":"PDF bytes are provider-rendered; compared by shape (byteLength) only in the scenario script"}},"responses":{"200":{"description":"Successful Response","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v3/order/{order_id}/requisition/pdf":{"parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","x-mockingbird-resource-ref":{"type":"order","missing":"00000000-0000-4000-8000-000000000000"}}}],"get":{"operationId":"get_order_requisition_pdf_v3_order__order_id__requisition_pdf_get","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":true,"reason":"Synthetic PDF includes persisted selected provider account number or unknown; admin evidence override supported; live comparison remains shape-only"}},"responses":{"200":{"description":"Successful Response","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v3/orders":{"get":{"operationId":"get_orders_v3_orders_get","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"parameters":[{"name":"user_id","in":"query","required":true,"schema":{"type":"string","format":"uuid","x-mockingbird-resource-ref":{"type":"user","missing":"00000000-0000-4000-8000-000000000000"}}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1}},{"name":"size","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":50}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetOrdersResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v3/order_transaction/{transaction_id}":{"parameters":[{"name":"transaction_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","x-mockingbird-resource-ref":{"type":"order_transaction","missing":"00000000-0000-4000-8000-000000000000"}}}],"get":{"operationId":"get_order_transaction_v3_order_transaction__transaction_id__get","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":true,"reason":"order transactions are not available to the sandbox team (feature not available)"}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetOrderTransactionResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v3/order_transaction/{transaction_id}/result":{"parameters":[{"name":"transaction_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","x-mockingbird-resource-ref":{"type":"order_transaction","missing":"00000000-0000-4000-8000-000000000000"}}}],"get":{"operationId":"get_order_transaction_result_v3_order_transaction__transaction_id__result_get","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":true,"reason":"lab results are not available to the sandbox team (feature not available)"}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LabResultsRaw"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"securitySchemes":{"apiKeyAuth":{"type":"apiKey","in":"header","name":"x-vital-api-key"}},"schemas":{"UserCreateBody":{"type":"object","required":["client_user_id"],"properties":{"client_user_id":{"type":"string","minLength":1,"maxLength":64,"examples":["mbr_8891","patient-1042","user.profile_52"]},"fallback_time_zone":{"type":["string","null"],"enum":["America/Los_Angeles","America/New_York","Europe/London","UTC",null]}}},"ClientFacingUser":{"type":"object","required":["user_id","team_id","client_user_id","created_on","connected_sources","fallback_time_zone"],"properties":{"user_id":{"type":"string","format":"uuid","x-mockingbird-resource":{"type":"user","identity":true},"x-mockingbird-volatile":{"kind":"id"}},"team_id":{"type":"string","format":"uuid","x-mockingbird-volatile":{"kind":"account"}},"client_user_id":{"type":"string"},"created_on":{"type":"string","format":"date-time","x-mockingbird-volatile":{"kind":"timestamp"}},"connected_sources":{"type":"array","items":{"type":"object","additionalProperties":true}},"fallback_time_zone":{"type":["object","null"],"properties":{"id":{"type":"string"},"source_slug":{"type":"string"},"updated_at":{"type":"string","format":"date-time","x-mockingbird-volatile":{"kind":"timestamp"}}}},"fallback_birth_date":{"type":["object","null"],"properties":{"value":{"type":"string"},"source_slug":{"type":"string"},"updated_at":{"type":"string","format":"date-time","x-mockingbird-volatile":{"kind":"timestamp"}}}},"ingestion_start":{"type":["string","null"]},"ingestion_end":{"type":["string","null"]}}},"UserInfoPatchBody":{"type":"object","properties":{"first_name":{"type":["string","null"]},"last_name":{"type":["string","null"]},"dob":{"type":["string","null"]},"gender":{"type":["string","null"]},"phone_number":{"type":["string","null"]},"email":{"type":["string","null"]},"address":{"type":["object","null"],"additionalProperties":true}}},"UserInfo":{"type":"object","additionalProperties":true},"ClientUserIDConflictResponse":{"type":"object","required":["detail"],"properties":{"detail":{"type":"object","required":["error_type","error_message","user_id","created_on"],"properties":{"error_type":{"type":"string"},"error_message":{"type":"string"},"user_id":{"type":"string","format":"uuid","x-mockingbird-volatile":{"kind":"id"}},"created_on":{"type":"string","format":"date-time","x-mockingbird-volatile":{"kind":"timestamp"}}}}}},"UserSuccessResponse":{"type":"object","required":["success"],"properties":{"success":{"type":"boolean"}}},"PaginatedUsersResponse":{"type":"object","required":["users","total","offset","limit"],"properties":{"users":{"type":"array","items":{"$ref":"#/components/schemas/ClientFacingUser"}},"total":{"type":"integer"},"offset":{"type":"integer"},"limit":{"type":"integer"}}},"UserPatchBody":{"type":"object","properties":{"fallback_time_zone":{"type":["string","null"]},"fallback_birth_date":{"type":["string","null"],"format":"date"},"ingestion_start":{"type":["string","null"],"format":"date"},"ingestion_end":{"type":["string","null"],"format":"date"},"client_user_id":{"type":["string","null"]}}},"LabTestCollectionMethod":{"type":"string","enum":["testkit","walk_in_test","at_home_phlebotomy","on_site_collection"]},"LabTestGenerationMethodFilter":{"type":"string","enum":["auto","manual","all"]},"LabTestSampleType":{"type":"string","enum":["dried_blood_spot","arm_collector","serum","saliva","urine","stool"]},"LabTestStatus":{"type":"string","enum":["active","pending_approval","inactive"]},"MarkerType":{"type":"string","enum":["biomarker","panel"]},"ClientFacingLab":{"type":"object","required":["id","slug","name","first_line_address","city","zipcode","collection_methods","sample_types"],"properties":{"id":{"type":"integer","x-mockingbird-volatile":{"kind":"id"}},"slug":{"type":"string"},"name":{"type":"string"},"first_line_address":{"type":"string"},"city":{"type":"string"},"zipcode":{"type":"string"},"collection_methods":{"type":"array","items":{"$ref":"#/components/schemas/LabTestCollectionMethod"}},"sample_types":{"type":"array","items":{"$ref":"#/components/schemas/LabTestSampleType"}},"logo_url":{"type":["string","null"]}}},"ClientFacingMarker":{"type":"object","required":["id","name","slug"],"properties":{"id":{"type":"integer","x-mockingbird-volatile":{"kind":"id"}},"name":{"type":"string"},"slug":{"type":"string"},"description":{"type":["string","null"]},"lab_id":{"type":["integer","null"]},"provider_id":{"type":["string","null"]},"type":{"anyOf":[{"$ref":"#/components/schemas/MarkerType"},{"type":"null"}]},"unit":{"type":["string","null"]},"price":{"type":["string","null"]},"aoe":{"anyOf":[{"type":"object","additionalProperties":true},{"type":"null"}]},"a_la_carte_enabled":{"type":"boolean","default":false},"common_tat_days":{"type":["integer","null"]},"worst_case_tat_days":{"type":["integer","null"]},"is_orderable":{"type":["boolean","null"],"default":true}}},"ClientFacingLabTest":{"type":"object","required":["id","slug","name","sample_type","method","price","is_active","status","lab","markers"],"properties":{"id":{"type":"string","format":"uuid","x-mockingbird-resource":{"type":"lab_test","identity":true}},"slug":{"type":"string","x-mockingbird-volatile":{"kind":"token"}},"name":{"type":"string","x-mockingbird-volatile":{"kind":"token"}},"sample_type":{"$ref":"#/components/schemas/LabTestSampleType"},"method":{"$ref":"#/components/schemas/LabTestCollectionMethod"},"price":{"type":"number"},"is_active":{"type":"boolean"},"status":{"$ref":"#/components/schemas/LabTestStatus"},"fasting":{"type":"boolean","default":false},"lab":{"anyOf":[{"$ref":"#/components/schemas/ClientFacingLab"},{"type":"null"}]},"markers":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ClientFacingMarker"}},{"type":"null"}]},"is_delegated":{"type":"boolean","default":false},"auto_generated":{"type":"boolean","default":false},"has_collection_instructions":{"type":["boolean","null"]},"common_tat_days":{"type":["integer","null"]},"worst_case_tat_days":{"type":["integer","null"]}}},"LabTestResourcesResponse":{"type":"object","required":["data","next_cursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ClientFacingLabTest"}},"next_cursor":{"type":["string","null"]}}},"LabAccountStatus":{"type":"string","enum":["active","pending","suspended","ready_to_launch"]},"LabAccountDelegatedFlow":{"type":"string","enum":["order_delegated","result_delegated","fully_delegated","not_delegated"]},"USState":{"type":"string","enum":["AL","AK","AZ","AR","CA","CO","CT","DE","FL","GA","HI","ID","IL","IN","IA","KS","KY","LA","ME","MD","MA","MI","MN","MS","MO","MT","NE","NV","NH","NJ","NM","NY","NC","ND","OH","OK","OR","PA","RI","SC","SD","TN","TX","UT","VT","VA","WA","WV","WI","WY"]},"Labs":{"type":"string","enum":["ayumetrix","spiriplex","ussl","quest","sonora_quest","labcorp","bioreference","us_biotek","manual","sanocardio","ihd","nexus","my_uti","crl","mtl"]},"ClientFacingLabAccount":{"type":"object","required":["id","lab","status","delegated_flow","provider_account_id","allowed_billing","team_id_allowlist"],"properties":{"id":{"type":"string","format":"uuid","x-mockingbird-resource":{"type":"lab_account","identity":true}},"lab":{"$ref":"#/components/schemas/Labs"},"org_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"status":{"$ref":"#/components/schemas/LabAccountStatus"},"delegated_flow":{"$ref":"#/components/schemas/LabAccountDelegatedFlow"},"provider_account_id":{"type":"string"},"account_name":{"anyOf":[{"type":"string"},{"type":"null"}]},"default_clinical_notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"business_units":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"allowed_billing":{"type":"object","propertyNames":{"$ref":"#/components/schemas/Billing"},"additionalProperties":{"type":"array","items":{"$ref":"#/components/schemas/USState"}}},"team_id_allowlist":{"type":"array","items":{"type":"string","format":"uuid"}}}},"GetTeamLabAccountsResponse":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ClientFacingLabAccount"}}}},"ClientFacingResult":{"type":"object","required":["name","slug","type"],"properties":{"name":{"type":"string"},"slug":{"type":"string"},"provider_id":{"type":["string","null"]},"type":{"$ref":"#/components/schemas/ResultType"},"value":{"type":["number","null"]},"unit":{"type":["string","null"]},"low_value":{"type":["number","null"]},"high_value":{"type":["number","null"]},"string_value":{"type":["string","null"]},"coded_value":{"type":["string","null"]},"is_abnormal":{"type":"boolean","default":false},"notes":{"type":["string","null"]}}},"GetMarkersResponse":{"type":"object","required":["markers"],"properties":{"markers":{"type":"array","items":{"$ref":"#/components/schemas/ClientFacingMarkerComplete"}},"total":{"type":["integer","null"]},"page":{"type":["integer","null"]},"size":{"type":["integer","null"]},"pages":{"type":["integer","null"]}}},"ClientFacingExpectedResult":{"type":"object","required":["id","name","slug","required"],"properties":{"id":{"type":"integer","x-mockingbird-volatile":{"kind":"id"}},"name":{"type":"string"},"slug":{"type":"string"},"lab_id":{"type":["integer","null"]},"provider_id":{"type":["string","null"]},"required":{"type":"boolean"},"loinc":{"type":["object","null"],"required":["id","name","slug","code"],"properties":{"id":{"type":"integer","x-mockingbird-volatile":{"kind":"id"}},"name":{"type":"string"},"slug":{"type":"string"},"code":{"type":"string"},"unit":{"type":["string","null"]}}}}},"ClientFacingMarkerComplete":{"type":"object","required":["id","name","slug","expected_results"],"properties":{"id":{"type":"integer","x-mockingbird-volatile":{"kind":"id"}},"name":{"type":"string"},"slug":{"type":"string"},"description":{"type":["string","null"]},"lab_id":{"type":["integer","null"]},"provider_id":{"type":["string","null"]},"type":{"anyOf":[{"$ref":"#/components/schemas/MarkerType"},{"type":"null"}]},"unit":{"type":["string","null"]},"price":{"type":["string","null"]},"a_la_carte_enabled":{"type":"boolean","default":false},"common_tat_days":{"type":["integer","null"]},"worst_case_tat_days":{"type":["integer","null"]},"is_orderable":{"type":["boolean","null"],"default":true},"expected_results":{"type":"array","items":{"$ref":"#/components/schemas/ClientFacingExpectedResult"}}}},"ListOrderSetMarkersRequest":{"type":"object","required":["order_set_id"],"properties":{"order_set_id":{"type":"string","format":"uuid","x-mockingbird-resource-ref":{"type":"order_transaction","missing":"00000000-0000-4000-8000-000000000000"}},"provider_id":{"type":["string","null"]}}},"AllowedRadius":{"type":"integer","enum":[10,20,25,50,100]},"AppointmentPscLabs":{"type":"string","enum":["quest"]},"AppointmentProvider":{"type":"string","enum":["getlabs","phlebfinders","quest"]},"AppointmentType":{"type":"string","enum":["phlebotomy","patient_service_center"]},"AppointmentStatus":{"type":"string","enum":["confirmed","pending","reserved","in_progress","completed","cancelled"]},"AppointmentEventStatus":{"type":"string","enum":["pending","reserved","scheduled","completed","cancelled","in_progress"]},"AppointmentServiceType":{"type":"string","enum":["appointment-ready","appointment-request"]},"Billing":{"type":"string","enum":["client_bill","commercial_insurance","patient_bill_passthrough","patient_bill"]},"LabLocationCapability":{"type":"string","enum":["stat","appointment_scheduling_via_junction","appointment_scheduling_with_lab"]},"LngLat":{"type":"object","required":["lng","lat"],"properties":{"lng":{"type":"number"},"lat":{"type":"number"}}},"UsAddress":{"type":"object","required":["first_line","city","state","zip_code"],"properties":{"first_line":{"type":"string","minLength":1},"second_line":{"type":["string","null"]},"city":{"type":"string","minLength":1},"state":{"type":"string","minLength":1},"zip_code":{"type":"string","minLength":1},"unit":{"type":["string","null"]}}},"AppointmentLocation":{"type":"object","required":["location","address","code","name"],"properties":{"location":{"$ref":"#/components/schemas/LngLat"},"distance":{"type":["number","null"]},"address":{"$ref":"#/components/schemas/UsAddress"},"code":{"type":"string"},"name":{"type":"string"},"iana_timezone":{"type":["string","null"]}}},"TimeSlot":{"type":"object","required":["start","end","price","is_priority","num_appointments_available"],"properties":{"booking_key":{"type":["string","null"],"x-mockingbird-resource":{"type":"booking_key","identity":true},"x-mockingbird-volatile":{"kind":"token"}},"start":{"type":"string","format":"date-time","x-mockingbird-volatile":{"kind":"timestamp"}},"end":{"type":"string","format":"date-time","x-mockingbird-volatile":{"kind":"timestamp"}},"expires_at":{"type":["string","null"],"x-mockingbird-volatile":{"kind":"timestamp"}},"price":{"type":"number"},"is_priority":{"type":"boolean"},"num_appointments_available":{"type":"integer"}}},"DaySlots":{"type":"object","required":["date","slots"],"properties":{"location":{"anyOf":[{"$ref":"#/components/schemas/AppointmentLocation"},{"type":"null"}]},"date":{"type":"string","format":"date"},"slots":{"type":"array","items":{"$ref":"#/components/schemas/TimeSlot"}}}},"AppointmentAvailabilitySlots":{"type":"object","required":["slots"],"properties":{"slots":{"type":"array","items":{"$ref":"#/components/schemas/DaySlots"}},"timezone":{"type":["string","null"]}}},"AppointmentBookingRequest":{"type":"object","required":["booking_key"],"properties":{"booking_key":{"type":"string","minLength":1,"x-mockingbird-resource-ref":{"type":"booking_key"}}}},"AppointmentRescheduleRequest":{"type":"object","required":["booking_key"],"properties":{"booking_key":{"type":"string","minLength":1,"x-mockingbird-resource-ref":{"type":"booking_key"}}}},"PscAppointmentBookingRequest":{"type":"object","required":["booking_key","site_code"],"properties":{"booking_key":{"type":"string","minLength":1,"x-mockingbird-resource-ref":{"type":"booking_key"}},"site_code":{"type":"string","minLength":1}}},"PhlebotomyAppointmentCancelRequest":{"type":"object","required":["cancellation_reason_id"],"properties":{"cancellation_reason_id":{"type":"string","minLength":1},"notes":{"type":["string","null"]}}},"PscAppointmentCancelRequest":{"type":"object","required":["cancellationReasonId"],"properties":{"cancellationReasonId":{"type":"string","minLength":1},"note":{"type":["string","null"]}}},"ClientFacingAppointmentEvent":{"type":"object","required":["created_at","status"],"properties":{"created_at":{"type":"string","format":"date-time","x-mockingbird-volatile":{"kind":"timestamp"}},"status":{"$ref":"#/components/schemas/AppointmentEventStatus"},"data":{"anyOf":[{"type":"object","additionalProperties":true},{"type":"null"}]}}},"ClientFacingAppointment":{"type":"object","required":["id","user_id","order_id","address","location","type","provider","status","provider_id","can_reschedule","event_status","events"],"properties":{"id":{"type":"string","format":"uuid","x-mockingbird-resource":{"type":"appointment","identity":true},"x-mockingbird-volatile":{"kind":"id"}},"user_id":{"type":"string","format":"uuid","x-mockingbird-resource-ref":{"type":"user"}},"order_id":{"type":"string","format":"uuid","x-mockingbird-resource-ref":{"type":"order"}},"address":{"$ref":"#/components/schemas/UsAddress"},"location":{"$ref":"#/components/schemas/LngLat"},"start_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"x-mockingbird-volatile":{"kind":"timestamp"}},"end_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"x-mockingbird-volatile":{"kind":"timestamp"}},"iana_timezone":{"type":["string","null"]},"type":{"$ref":"#/components/schemas/AppointmentType"},"provider":{"$ref":"#/components/schemas/AppointmentProvider"},"status":{"$ref":"#/components/schemas/AppointmentStatus"},"provider_id":{"type":"string","x-mockingbird-volatile":{"kind":"id"}},"external_id":{"type":["string","null"],"x-mockingbird-volatile":{"kind":"id"}},"can_reschedule":{"type":"boolean"},"event_status":{"$ref":"#/components/schemas/AppointmentEventStatus"},"event_data":{"anyOf":[{"type":"object","additionalProperties":true},{"type":"null"}]},"order_transaction_id":{"type":["string","null"],"x-mockingbird-resource-ref":{"type":"order_transaction"}},"appointment_notes":{"type":["string","null"]},"events":{"type":"array","items":{"$ref":"#/components/schemas/ClientFacingAppointmentEvent"}}}},"ClientFacingAppointmentCancellationReason":{"type":"object","required":["id","name","is_refundable"],"properties":{"id":{"type":"string","x-mockingbird-volatile":{"kind":"id"}},"name":{"type":"string"},"is_refundable":{"type":"boolean"}}},"PhlebotomyAreaInfo":{"type":"object","required":["is_served","providers"],"properties":{"is_served":{"type":"boolean"},"providers":{"type":"array","items":{"$ref":"#/components/schemas/PhlebotomyProviderInfo"}}}},"PhlebotomyProviderInfo":{"type":"object","required":["name","service_types"],"properties":{"name":{"$ref":"#/components/schemas/AppointmentProvider"},"service_types":{"type":"array","items":{"$ref":"#/components/schemas/AppointmentServiceType"}}}},"PscAreaInfoDetails":{"type":"object","required":["appointment_with_vital","within_radius","radius"],"properties":{"appointment_with_vital":{"type":"boolean"},"within_radius":{"type":"number"},"radius":{"type":"string"},"capabilities":{"type":["array","null"],"items":{"$ref":"#/components/schemas/LabLocationCapability"}}}},"PscAreaInfo":{"type":"object","required":["patient_service_centers","supported_bill_types","lab_id"],"properties":{"patient_service_centers":{"$ref":"#/components/schemas/PscAreaInfoDetails"},"supported_bill_types":{"type":"array","items":{"$ref":"#/components/schemas/Billing"}},"lab_id":{"type":"integer"}}},"AreaInfo":{"type":"object","required":["zip_code","phlebotomy","central_labs"],"properties":{"zip_code":{"type":"string"},"phlebotomy":{"$ref":"#/components/schemas/PhlebotomyAreaInfo"},"central_labs":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/PscAreaInfo"}}}},"LabLocationMetadata":{"type":"object","required":["name","state","city","zip_code","first_line"],"properties":{"name":{"type":"string"},"state":{"type":"string"},"city":{"type":"string"},"zip_code":{"type":"string"},"first_line":{"type":"string"},"second_line":{"type":["string","null"]},"phone_number":{"type":["string","null"]},"fax_number":{"type":["string","null"]},"hours":{"type":["object","null"],"additionalProperties":true}}},"ClientFacingLabLocation":{"type":"object","required":["metadata","distance","site_code","supported_bill_types","location","capabilities"],"properties":{"metadata":{"$ref":"#/components/schemas/LabLocationMetadata"},"distance":{"type":"number"},"site_code":{"type":"string"},"supported_bill_types":{"type":"array","items":{"$ref":"#/components/schemas/Billing"}},"location":{"$ref":"#/components/schemas/LngLat"},"capabilities":{"type":"array","items":{"$ref":"#/components/schemas/LabLocationCapability"}}}},"PscInfo":{"type":"object","required":["lab_id","slug","patient_service_centers"],"properties":{"lab_id":{"type":"integer"},"slug":{"type":"string"},"patient_service_centers":{"type":"array","items":{"$ref":"#/components/schemas/ClientFacingLabLocation"}}}},"OrderTopLevelStatus":{"type":"string","enum":["received","collecting_sample","sample_with_lab","completed","cancelled","failed"]},"OrderLowLevelStatus":{"type":"string","enum":["ordered","requisition_created","requisition_bypassed","transit_customer","out_for_delivery","with_customer","transit_lab","delivered_to_lab","completed","failure_to_deliver_to_lab","failure_to_deliver_to_customer","problem_in_transit_lab","problem_in_transit_customer","sample_error","appointment_scheduled","appointment_cancelled","appointment_pending","draw_completed","cancelled","lost","do_not_process","partial_results","awaiting_registration","registered","redraw_available","corrected","lab_processing_blocked"]},"OrderStatus":{"type":"string","enum":["received.walk_in_test.ordered","received.walk_in_test.requisition_created","received.walk_in_test.requisition_bypassed","completed.walk_in_test.completed","sample_with_lab.walk_in_test.partial_results","failed.walk_in_test.sample_error","cancelled.walk_in_test.cancelled","collecting_sample.walk_in_test.appointment_pending","collecting_sample.walk_in_test.appointment_scheduled","collecting_sample.walk_in_test.appointment_cancelled","collecting_sample.walk_in_test.redraw_available","received.at_home_phlebotomy.ordered","received.at_home_phlebotomy.requisition_created","received.at_home_phlebotomy.requisition_bypassed","collecting_sample.at_home_phlebotomy.appointment_pending","collecting_sample.at_home_phlebotomy.appointment_scheduled","collecting_sample.at_home_phlebotomy.draw_completed","collecting_sample.at_home_phlebotomy.appointment_cancelled","completed.at_home_phlebotomy.completed","sample_with_lab.at_home_phlebotomy.partial_results","cancelled.at_home_phlebotomy.cancelled","failed.at_home_phlebotomy.sample_error","received.testkit.ordered","received.testkit.awaiting_registration","received.testkit.requisition_created","received.testkit.requisition_bypassed","received.testkit.registered","collecting_sample.testkit.transit_customer","collecting_sample.testkit.out_for_delivery","collecting_sample.testkit.with_customer","collecting_sample.testkit.transit_lab","sample_with_lab.testkit.delivered_to_lab","sample_with_lab.testkit.lab_processing_blocked","completed.testkit.completed","failed.testkit.failure_to_deliver_to_customer","failed.testkit.failure_to_deliver_to_lab","failed.testkit.sample_error","failed.testkit.lost","cancelled.testkit.cancelled","cancelled.testkit.do_not_process","collecting_sample.testkit.problem_in_transit_customer","collecting_sample.testkit.problem_in_transit_lab","received.on_site_collection.ordered","received.on_site_collection.requisition_created","received.on_site_collection.requisition_bypassed","sample_with_lab.on_site_collection.draw_completed","completed.on_site_collection.completed","cancelled.on_site_collection.cancelled","sample_with_lab.on_site_collection.partial_results","failed.on_site_collection.sample_error","completed.walk_in_test.corrected","completed.at_home_phlebotomy.corrected","completed.on_site_collection.corrected","completed.testkit.corrected"]},"OrderStatusDetail":{"type":"string","enum":["fulfillment_error","date_of_collection_unspecified","demographic_information_unspecified","demographic_information_mismatch","sample_quantity_not_sufficient","sample_contaminated","sample_stability_exceeded","sample_hemolyzed","sample_improper_collection"]},"OrderTransactionStatus":{"type":"string","enum":["active","completed","cancelled"]},"ClientFacingOrderEvent":{"type":"object","required":["id","created_at","status"],"properties":{"id":{"type":"integer","x-mockingbird-volatile":{"kind":"opaque"}},"created_at":{"type":"string","format":"date-time","x-mockingbird-volatile":{"kind":"timestamp"}},"status":{"$ref":"#/components/schemas/OrderStatus"},"status_detail":{"anyOf":[{"$ref":"#/components/schemas/OrderStatusDetail"},{"type":"null"}]}}},"ShippingAddress":{"type":"object","required":["receiver_name","first_line","city","state","zip","country","phone_number"],"properties":{"receiver_name":{"type":"string"},"first_line":{"type":"string"},"second_line":{"type":["string","null"]},"city":{"type":"string"},"state":{"type":"string"},"zip":{"type":"string"},"country":{"type":"string"},"phone_number":{"type":"string"}}},"ClientFacingPhysician":{"type":"object","required":["first_name","last_name","npi"],"properties":{"first_name":{"type":"string"},"last_name":{"type":"string"},"npi":{"type":"string"}}},"ClientFacingShipment":{"type":"object","required":["id","outbound_tracking_number","outbound_tracking_url","inbound_tracking_number","inbound_tracking_url","outbound_courier","inbound_courier","notes"],"properties":{"id":{"type":"string","format":"uuid","x-mockingbird-volatile":{"kind":"id"}},"outbound_tracking_number":{"type":["string","null"]},"outbound_tracking_url":{"type":["string","null"]},"inbound_tracking_number":{"type":["string","null"]},"inbound_tracking_url":{"type":["string","null"]},"outbound_courier":{"type":["string","null"]},"inbound_courier":{"type":["string","null"]},"notes":{"type":["string","null"]}}},"ClientFacingTestkitOrder":{"type":"object","required":["id","shipment","created_at","updated_at"],"properties":{"id":{"type":"string","format":"uuid","x-mockingbird-volatile":{"kind":"id"}},"shipment":{"anyOf":[{"$ref":"#/components/schemas/ClientFacingShipment"},{"type":"null"}],"x-mockingbird-volatile":{"kind":"opaque"}},"created_at":{"type":"string","format":"date-time","x-mockingbird-volatile":{"kind":"timestamp"}},"updated_at":{"type":"string","format":"date-time","x-mockingbird-volatile":{"kind":"timestamp"}}}},"ClientFacingWalkInOrder":{"type":"object","required":["id","appointment_id","created_at","updated_at"],"properties":{"id":{"type":"string","format":"uuid","x-mockingbird-volatile":{"kind":"id"}},"appointment_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","x-mockingbird-volatile":{"kind":"timestamp"}},"updated_at":{"type":"string","format":"date-time","x-mockingbird-volatile":{"kind":"timestamp"}}}},"ClientFacingTestKitOrderDetails":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["testkit","walk_in_test","at_home_phlebotomy","on_site_collection"]},"data":{"anyOf":[{"$ref":"#/components/schemas/ClientFacingTestkitOrder"},{"$ref":"#/components/schemas/ClientFacingWalkInOrder"},{"type":"null"}]}}},"ClientFacingPatientDetailsCompatible":{"type":"object","required":["first_name","last_name","dob","gender","phone_number","email"],"properties":{"first_name":{"type":"string","minLength":1,"pattern":"^[a-zA-Z0-9][a-zA-Z0-9 .,'-]*$","examples":["Ada","Chris","Maria","Jun"]},"last_name":{"type":"string","minLength":1,"pattern":"^[a-zA-Z0-9][a-zA-Z0-9 .,'-]*$","examples":["Lovelace","Vouga","Delgado","Park"]},"dob":{"type":"string","format":"date-time","examples":["1990-06-15T00:00:00.000Z","1983-02-02T00:00:00.000Z"]},"gender":{"type":"string","minLength":1,"pattern":"\\\\S","examples":["male","female","other","prefer_not_to_say"]},"phone_number":{"type":"string","minLength":1,"pattern":"^\\\\+1[2-9]\\\\d{9}$","examples":["+14155550123","+12125550987","+13105554444"]},"email":{"type":"string","format":"email","minLength":1,"examples":["ada@example.com","chris@example.com","maria@example.com"]}}},"PatientAddressCompatible":{"type":"object","required":["first_line","city","state","zip","country"],"properties":{"receiver_name":{"type":"string","default":"","examples":["Ada Lovelace","Chris Vouga"]},"first_line":{"type":"string","minLength":1,"pattern":"\\\\S","examples":["1 Main St","450 Market St","88 Kearny St"]},"second_line":{"type":["string","null"]},"city":{"type":"string","minLength":1,"pattern":"\\\\S","examples":["San Diego","San Francisco","New York"]},"state":{"type":"string","minLength":1,"enum":["AL","AK","AZ","AR","CA","CO","CT","DE","FL","GA","HI","ID","IL","IN","IA","KS","KY","LA","ME","MD","MA","MI","MN","MS","MO","MT","NE","NV","NH","NJ","NM","NY","NC","ND","OH","OK","OR","PA","RI","SC","SD","TN","TX","UT","VT","VA","WA","WV","WI","WY"]},"zip":{"type":"string","pattern":"^\\\\d{5}(-\\\\d{4})?$","examples":["92101","94105","10001"]},"country":{"type":"string","minLength":1,"pattern":"\\\\S","examples":["US"]},"access_notes":{"type":["string","null"],"examples":[null]},"phone_number":{"type":["string","null"],"examples":["+14155550123",null]}}},"AoeAnswerRequest":{"type":"object","required":["marker_id","question_id","answer"],"properties":{"marker_id":{"type":"integer","examples":[2075,1975]},"question_id":{"type":"integer","examples":[1]},"answer":{"type":"string","minLength":1,"examples":["No","Yes"]}}},"ClientFacingOrderInTransaction":{"type":"object","required":["id","created_at","updated_at"],"properties":{"id":{"type":"string","format":"uuid"},"low_level_status":{"anyOf":[{"$ref":"#/components/schemas/OrderLowLevelStatus"},{"type":"null"}]},"low_level_status_created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"x-mockingbird-volatile":{"kind":"timestamp"}},"created_at":{"type":"string","format":"date-time","x-mockingbird-volatile":{"kind":"timestamp"}},"updated_at":{"type":"string","format":"date-time","x-mockingbird-volatile":{"kind":"timestamp"}}}},"ClientFacingOrderTransaction":{"type":"object","required":["id","status","orders"],"properties":{"id":{"type":"string","format":"uuid","x-mockingbird-resource":{"type":"order_transaction","identity":true},"x-mockingbird-volatile":{"kind":"id"}},"status":{"$ref":"#/components/schemas/OrderTransactionStatus"},"orders":{"type":"array","items":{"$ref":"#/components/schemas/ClientFacingOrderInTransaction"}}}},"OrderSummary":{"type":"object","required":["id","last_status","last_status_created_at","updated_at","created_at"],"properties":{"id":{"type":"string","format":"uuid"},"origin":{"anyOf":[{"type":"string","enum":["initial","redraw","recreation"]},{"type":"null"}]},"parent_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"last_status":{"$ref":"#/components/schemas/OrderLowLevelStatus"},"last_status_created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"created_at":{"type":"string","format":"date-time"}}},"GetOrderTransactionResponse":{"type":"object","required":["id","team_id","status"],"properties":{"id":{"type":"string","format":"uuid","x-mockingbird-resource":{"type":"order_transaction","identity":true},"x-mockingbird-volatile":{"kind":"id"}},"team_id":{"type":"string","format":"uuid","x-mockingbird-volatile":{"kind":"account"}},"status":{"$ref":"#/components/schemas/OrderTransactionStatus"},"orders":{"type":"array","items":{"$ref":"#/components/schemas/OrderSummary"}}}},"ClientFacingOrder":{"type":"object","description":"Account profiles expose lab_account_id from the persisted selected association; native preserves the legacy response shape.","required":["user_id","id","team_id","patient_details","patient_address","lab_test","details","sample_id","notes","created_at","updated_at","events","last_event","health_insurance_id","requisition_form_url","shipping_details","has_abn"],"properties":{"lab_account_id":{"type":["string","null"],"format":"uuid"},"user_id":{"type":"string","format":"uuid"},"id":{"type":"string","format":"uuid","x-mockingbird-resource":{"type":"order","identity":true},"x-mockingbird-volatile":{"kind":"id"}},"team_id":{"type":"string","format":"uuid","x-mockingbird-volatile":{"kind":"account"}},"patient_details":{"anyOf":[{"$ref":"#/components/schemas/ClientFacingPatientDetailsCompatible"},{"type":"null"}]},"patient_address":{"anyOf":[{"$ref":"#/components/schemas/PatientAddressCompatible"},{"type":"null"}]},"lab_test":{"$ref":"#/components/schemas/ClientFacingLabTest"},"details":{"$ref":"#/components/schemas/ClientFacingTestKitOrderDetails"},"sample_id":{"anyOf":[{"type":"string"},{"type":"null"}],"x-mockingbird-volatile":{"kind":"opaque"}},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"clinical_notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","x-mockingbird-volatile":{"kind":"timestamp"}},"updated_at":{"type":"string","format":"date-time","x-mockingbird-volatile":{"kind":"timestamp"}},"events":{"type":"array","items":{"$ref":"#/components/schemas/ClientFacingOrderEvent"}},"status":{"anyOf":[{"$ref":"#/components/schemas/OrderTopLevelStatus"},{"type":"null"}],"x-mockingbird-volatile":{"kind":"opaque"}},"last_event":{"$ref":"#/components/schemas/ClientFacingOrderEvent"},"physician":{"anyOf":[{"$ref":"#/components/schemas/ClientFacingPhysician"},{"type":"null"}]},"health_insurance_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"requisition_form_url":{"anyOf":[{"type":"string"},{"type":"null"}],"x-mockingbird-volatile":{"kind":"url"}},"priority":{"type":"boolean","default":false},"shipping_details":{"anyOf":[{"$ref":"#/components/schemas/ShippingAddress"},{"type":"null"}]},"activate_by":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}]},"passthrough":{"anyOf":[{"type":"string"},{"type":"null"}]},"billing_type":{"type":"string","enum":["client_bill","commercial_insurance","patient_bill_passthrough","patient_bill","upfront_payment"],"default":"client_bill"},"icd_codes":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"has_abn":{"type":"boolean"},"interpretation":{"anyOf":[{"type":"string","enum":["normal","abnormal","critical","unknown"]},{"type":"null"}]},"has_missing_results":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"expected_result_by_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}]},"worst_case_result_by_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}]},"origin":{"anyOf":[{"type":"string","enum":["initial","redraw","recreation"]},{"type":"null"}]},"order_transaction":{"anyOf":[{"$ref":"#/components/schemas/ClientFacingOrderTransaction"},{"type":"null"}]}}},"OrderSetRequest":{"type":"object","anyOf":[{"required":["lab_test_ids"]},{"required":["add_on"]}],"properties":{"add_on":{"type":"object","description":"Custom marker orders are supported by the explicit expected-contract and sandbox-observed profiles.","properties":{"marker_ids":{"type":"array","items":{"type":"integer"}},"provider_ids":{"type":"array","items":{"type":"string"}}}},"lab_test_ids":{"type":"array","minItems":1,"items":{"type":"string","format":"uuid","x-mockingbird-resource-ref":{"type":"lab_test","missing":"00000000-0000-4000-8000-000000000000"}}}}},"CreateOrderRequest":{"type":"object","required":["user_id","patient_details","patient_address","order_set"],"properties":{"user_id":{"type":"string","format":"uuid","x-mockingbird-resource-ref":{"type":"user","missing":"00000000-0000-4000-8000-000000000000"}},"patient_details":{"$ref":"#/components/schemas/ClientFacingPatientDetailsCompatible"},"patient_address":{"$ref":"#/components/schemas/PatientAddressCompatible"},"order_set":{"$ref":"#/components/schemas/OrderSetRequest"},"clinical_notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"passthrough":{"anyOf":[{"type":"string"},{"type":"null"}]},"collection_method":{"$ref":"#/components/schemas/LabTestCollectionMethod"},"lab_account_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}]},"idempotency_key":{"type":["string","null"]},"idempotency_error":{"type":["string","null"]},"aoe_answers":{"type":["array","null"],"items":{"$ref":"#/components/schemas/AoeAnswerRequest"}}}},"PostOrderResponse":{"type":"object","required":["order","status","message"],"properties":{"order":{"$ref":"#/components/schemas/ClientFacingOrder"},"status":{"type":"string"},"message":{"type":"string"}}},"ResultType":{"type":"string","enum":["numeric","range","comment","coded_value"]},"ParentBiomarkerData":{"type":"object","required":["marker_id","name","slug"],"properties":{"marker_id":{"type":"integer"},"name":{"type":"string"},"slug":{"type":"string"},"provider_id":{"type":["string","null"]}}},"BiomarkerResult":{"type":"object","required":["name","result","type"],"properties":{"name":{"type":"string"},"slug":{"type":"string","default":""},"value":{"anyOf":[{"type":"number"},{"type":"null"}]},"result":{"type":"string"},"type":{"$ref":"#/components/schemas/ResultType"},"unit":{"type":["string","null"]},"timestamp":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"x-mockingbird-volatile":{"kind":"timestamp"}},"notes":{"type":["string","null"]},"reference_range":{"type":["string","null"]},"min_range_value":{"type":["number","null"]},"max_range_value":{"type":["number","null"]},"is_above_max_range":{"type":["boolean","null"]},"is_below_min_range":{"type":["boolean","null"]},"interpretation":{"type":"string","default":"normal"},"source_interpretation":{"type":"string","default":""},"loinc":{"type":["string","null"]},"loinc_slug":{"type":["string","null"]},"provider_id":{"type":["string","null"]},"source_markers":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ParentBiomarkerData"}},{"type":"null"}]},"performing_laboratory":{"type":["string","null"]},"source_sample_id":{"type":["string","null"]}}},"FailureType":{"type":"string","enum":["quantity_not_sufficient_failure","collection_process_failure","drop_off_failure","internal_lab_failure","order_entry_failure","non_failure","unknown_failure","patient_condition_failure","missing_result_calc_failure","missing_demo_aoe_calc_failure","insufficient_volume"]},"MissingBiomarkerResult":{"type":"object","required":["name","slug","inferred_failure_type"],"properties":{"name":{"type":"string"},"slug":{"type":"string"},"inferred_failure_type":{"$ref":"#/components/schemas/FailureType"},"note":{"type":["string","null"]},"loinc":{"type":["string","null"]},"loinc_slug":{"type":["string","null"]},"provider_id":{"type":["string","null"]},"source_markers":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ParentBiomarkerData"}},{"type":"null"}]}}},"SampleData":{"type":"object","properties":{"sample_id":{"type":["string","null"]},"control_number":{"type":["string","null"]},"date_collected":{"type":["string","null"]},"date_received":{"type":["string","null"]},"date_reported":{"type":["string","null"]},"performing_laboratories":{"anyOf":[{"type":"object","additionalProperties":true},{"type":"null"}]},"clinical_information":{"anyOf":[{"type":"object","additionalProperties":true},{"type":"null"}]}}},"LabResultsMetadata":{"type":"object","required":["age","dob","patient","date_reported","specimen_number"],"properties":{"age":{"type":"string","x-mockingbird-volatile":{"kind":"token"}},"dob":{"type":"string","x-mockingbird-volatile":{"kind":"token"}},"clia_#":{"anyOf":[{"type":"string"},{"type":"null"}]},"patient":{"type":"string","x-mockingbird-volatile":{"kind":"token"}},"provider":{"anyOf":[{"type":"string"},{"type":"null"}],"x-mockingbird-volatile":{"kind":"token"}},"laboratory":{"anyOf":[{"type":"string"},{"type":"null"}],"x-mockingbird-volatile":{"kind":"token"}},"date_reported":{"type":"string","x-mockingbird-volatile":{"kind":"timestamp"}},"date_collected":{"anyOf":[{"type":"string"},{"type":"null"}],"x-mockingbird-volatile":{"kind":"timestamp"}},"specimen_number":{"type":"string","x-mockingbird-volatile":{"kind":"id"}},"date_received":{"anyOf":[{"type":"string"},{"type":"null"}],"x-mockingbird-volatile":{"kind":"timestamp"}},"status":{"type":"string","default":"final"},"interpretation":{"anyOf":[{"type":"string"},{"type":"null"}]},"patient_id":{"anyOf":[{"type":"string"},{"type":"null"}],"x-mockingbird-volatile":{"kind":"id"}},"account_id":{"anyOf":[{"type":"string"},{"type":"null"}],"x-mockingbird-volatile":{"kind":"id"}}}},"LabResultsRaw":{"type":"object","required":["metadata","results"],"properties":{"metadata":{"$ref":"#/components/schemas/LabResultsMetadata"},"results":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/BiomarkerResult"}},{"type":"object","additionalProperties":true}],"x-mockingbird-volatile":{"kind":"opaque"}},"missing_results":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/MissingBiomarkerResult"}},{"type":"null"}],"x-mockingbird-volatile":{"kind":"opaque"}},"sample_information":{"anyOf":[{"type":"object","additionalProperties":{"$ref":"#/components/schemas/SampleData"}},{"type":"null"}],"x-mockingbird-volatile":{"kind":"opaque"}},"order_transaction":{"anyOf":[{"$ref":"#/components/schemas/ClientFacingOrderTransaction"},{"type":"null"}]}}},"SimulationFlags":{"type":"object","properties":{"interpretation":{"anyOf":[{"type":"string","enum":["normal","abnormal","critical","unknown"]},{"type":"null"}]},"result_types":{"type":"array","items":{"$ref":"#/components/schemas/ResultType"}},"has_missing_results":{"type":"boolean"}}},"GetOrdersResponse":{"type":"object","required":["orders"],"properties":{"orders":{"type":"array","items":{"$ref":"#/components/schemas/ClientFacingOrder"}},"total":{"anyOf":[{"type":"integer"},{"type":"null"}]},"page":{"anyOf":[{"type":"integer"},{"type":"null"}]},"size":{"anyOf":[{"type":"integer"},{"type":"null"}]}}},"HTTPValidationError":{"type":"object","properties":{"detail":{"title":"Detail"}}}}}}`);
9998
10105
  var operationIds = ["get_teams_users_v2_user_get", "create_user_v2_user_post", "get_user_v2_user__user_id__get", "delete_user_v2_user__user_id__delete", "patch_user_v2_user__user_id__patch", "get_user_by_client_user_id_v2_user_resolve__client_user_id__get", "patch_user_info_v2_user__user_id__info_patch", "get_latest_user_info_user_v2_user__user_id__info_latest_get", "get_paginated_lab_tests_for_team_v3_lab_test_get", "get_team_lab_accounts_v3_lab_test_lab_account_get", "get_lab_tests_for_team_v3_lab_tests_get", "get_lab_test_for_team_v3_lab_tests__lab_test_id__get", "get_labs_v3_lab_tests_labs_get", "get_markers_for_lab_test_v3_lab_tests__lab_test_id__markers_get", "list_order_set_markers_v3_lab_tests_list_order_set_markers_post", "create_order_v3_order_post", "get_area_info_v3_order_area_info_get", "get_psc_info_v3_order_psc_info_get", "get_phlebotomy_appointment_availability_v3_order_phlebotomy_appointment_availability_post", "get_phlebotomy_appointment_cancellation_reason_v3_order_phlebotomy_appointment_cancellation_reasons_get", "get_psc_appointment_availability_v3_order_psc_appointment_availability_post", "get_psc_appointment_cancellation_reason_v3_order_psc_appointment_cancellation_reasons_get", "get_phlebotomy_appointment_v3_order__order_id__phlebotomy_appointment_get", "book_phlebotomy_appointment_v3_order__order_id__phlebotomy_appointment_book_post", "reschedule_phlebotomy_appointment_v3_order__order_id__phlebotomy_appointment_reschedule_patch", "cancel_phlebotomy_appointment_v3_order__order_id__phlebotomy_appointment_cancel_patch", "get_psc_appointment_v3_order__order_id__psc_appointment_get", "book_psc_appointment_v3_order__order_id__psc_appointment_book_post", "reschedule_psc_appointment_v3_order__order_id__psc_appointment_reschedule_patch", "cancel_psc_appointment_v3_order__order_id__psc_appointment_cancel_patch", "get_order_v3_order__order_id__get", "cancel_order_v3_order__order_id__cancel_post", "simulate_order_v3_order__order_id__test_post", "get_result_raw_v3_order__order_id__result_get", "get_result_metadata_v3_order__order_id__result_metadata_get", "get_result_pdf_v3_order__order_id__result_pdf_get", "get_order_requisition_pdf_v3_order__order_id__requisition_pdf_get", "get_orders_v3_orders_get", "get_order_transaction_v3_order_transaction__transaction_id__get", "get_order_transaction_result_v3_order_transaction__transaction_id__result_get"];
9999
10106
  var supportedOperationIds = ["get_teams_users_v2_user_get", "create_user_v2_user_post", "get_user_v2_user__user_id__get", "delete_user_v2_user__user_id__delete", "patch_user_v2_user__user_id__patch", "get_user_by_client_user_id_v2_user_resolve__client_user_id__get", "patch_user_info_v2_user__user_id__info_patch", "get_latest_user_info_user_v2_user__user_id__info_latest_get", "get_paginated_lab_tests_for_team_v3_lab_test_get", "get_team_lab_accounts_v3_lab_test_lab_account_get", "get_lab_tests_for_team_v3_lab_tests_get", "get_lab_test_for_team_v3_lab_tests__lab_test_id__get", "get_labs_v3_lab_tests_labs_get", "get_markers_for_lab_test_v3_lab_tests__lab_test_id__markers_get", "list_order_set_markers_v3_lab_tests_list_order_set_markers_post", "create_order_v3_order_post", "get_area_info_v3_order_area_info_get", "get_psc_info_v3_order_psc_info_get", "get_phlebotomy_appointment_availability_v3_order_phlebotomy_appointment_availability_post", "get_phlebotomy_appointment_cancellation_reason_v3_order_phlebotomy_appointment_cancellation_reasons_get", "get_psc_appointment_availability_v3_order_psc_appointment_availability_post", "get_psc_appointment_cancellation_reason_v3_order_psc_appointment_cancellation_reasons_get", "get_phlebotomy_appointment_v3_order__order_id__phlebotomy_appointment_get", "book_phlebotomy_appointment_v3_order__order_id__phlebotomy_appointment_book_post", "reschedule_phlebotomy_appointment_v3_order__order_id__phlebotomy_appointment_reschedule_patch", "cancel_phlebotomy_appointment_v3_order__order_id__phlebotomy_appointment_cancel_patch", "get_psc_appointment_v3_order__order_id__psc_appointment_get", "book_psc_appointment_v3_order__order_id__psc_appointment_book_post", "reschedule_psc_appointment_v3_order__order_id__psc_appointment_reschedule_patch", "cancel_psc_appointment_v3_order__order_id__psc_appointment_cancel_patch", "get_order_v3_order__order_id__get", "cancel_order_v3_order__order_id__cancel_post", "simulate_order_v3_order__order_id__test_post", "get_result_raw_v3_order__order_id__result_get", "get_result_metadata_v3_order__order_id__result_metadata_get", "get_result_pdf_v3_order__order_id__result_pdf_get", "get_order_requisition_pdf_v3_order__order_id__requisition_pdf_get", "get_orders_v3_orders_get", "get_order_transaction_v3_order_transaction__transaction_id__get", "get_order_transaction_result_v3_order_transaction__transaction_id__result_get"];
10000
10107
 
@@ -10243,10 +10350,10 @@ var alignBookingKeyAddresses = (state, body, requestBody, zip, modalityHint) =>
10243
10350
  if (typeof slot !== "object" || slot === null || Array.isArray(slot)) continue;
10244
10351
  const bookingKey = slot.booking_key;
10245
10352
  if (typeof bookingKey !== "string" || bookingKey === "") continue;
10246
- const record = state.bookingKeys.get(bookingKey);
10247
- if (!record || modalityHint !== void 0 && record.modality !== modalityHint) continue;
10248
- record.address = addressFromAvailabilityRequest(requestBody, zip);
10249
- state.bookingKeys.update(bookingKey, record);
10353
+ const record2 = state.bookingKeys.get(bookingKey);
10354
+ if (!record2 || modalityHint !== void 0 && record2.modality !== modalityHint) continue;
10355
+ record2.address = addressFromAvailabilityRequest(requestBody, zip);
10356
+ state.bookingKeys.update(bookingKey, record2);
10250
10357
  }
10251
10358
  }
10252
10359
  };
@@ -10269,48 +10376,48 @@ var readJson2 = async (response) => {
10269
10376
  var asRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value) ? value : void 0;
10270
10377
  var asString = (value) => typeof value === "string" ? value : void 0;
10271
10378
  var mapUser = (value) => {
10272
- const record = asRecord(value);
10273
- if (!record) return void 0;
10274
- const userId = asString(record.user_id);
10275
- const clientUserId = asString(record.client_user_id);
10379
+ const record2 = asRecord(value);
10380
+ if (!record2) return void 0;
10381
+ const userId = asString(record2.user_id);
10382
+ const clientUserId = asString(record2.client_user_id);
10276
10383
  if (!userId || !clientUserId) return void 0;
10277
10384
  return {
10278
10385
  user_id: userId,
10279
- team_id: asString(record.team_id) ?? "00000000-0000-4000-8000-000000000000",
10386
+ team_id: asString(record2.team_id) ?? "00000000-0000-4000-8000-000000000000",
10280
10387
  client_user_id: clientUserId,
10281
- created_on: asString(record.created_on) ?? (/* @__PURE__ */ new Date(0)).toISOString(),
10282
- connected_sources: Array.isArray(record.connected_sources) ? record.connected_sources : [],
10283
- fallback_time_zone: typeof record.fallback_time_zone === "object" && record.fallback_time_zone !== null ? record.fallback_time_zone : null,
10284
- fallback_birth_date: typeof record.fallback_birth_date === "object" && record.fallback_birth_date !== null ? record.fallback_birth_date : null,
10285
- ingestion_start: asString(record.ingestion_start) ?? null,
10286
- ingestion_end: asString(record.ingestion_end) ?? null
10388
+ created_on: asString(record2.created_on) ?? (/* @__PURE__ */ new Date(0)).toISOString(),
10389
+ connected_sources: Array.isArray(record2.connected_sources) ? record2.connected_sources : [],
10390
+ fallback_time_zone: typeof record2.fallback_time_zone === "object" && record2.fallback_time_zone !== null ? record2.fallback_time_zone : null,
10391
+ fallback_birth_date: typeof record2.fallback_birth_date === "object" && record2.fallback_birth_date !== null ? record2.fallback_birth_date : null,
10392
+ ingestion_start: asString(record2.ingestion_start) ?? null,
10393
+ ingestion_end: asString(record2.ingestion_end) ?? null
10287
10394
  };
10288
10395
  };
10289
10396
  var mapLabTest = (value) => {
10290
- const record = asRecord(value);
10291
- if (!record) return void 0;
10292
- const id = asString(record.id);
10397
+ const record2 = asRecord(value);
10398
+ if (!record2) return void 0;
10399
+ const id = asString(record2.id);
10293
10400
  if (!id) return void 0;
10294
- return clone2(record);
10401
+ return clone2(record2);
10295
10402
  };
10296
10403
  var mapOrder = (value) => {
10297
- const record = asRecord(value);
10298
- if (!record) return void 0;
10299
- const id = asString(record.id);
10300
- const userId = asString(record.user_id);
10404
+ const record2 = asRecord(value);
10405
+ if (!record2) return void 0;
10406
+ const id = asString(record2.id);
10407
+ const userId = asString(record2.user_id);
10301
10408
  if (!id || !userId) return void 0;
10302
- return clone2(record);
10409
+ return clone2(record2);
10303
10410
  };
10304
10411
  var mapAppointment = (value, orderId, userId) => {
10305
- const record = asRecord(value);
10306
- if (!record) return void 0;
10307
- const id = asString(record.id);
10412
+ const record2 = asRecord(value);
10413
+ if (!record2) return void 0;
10414
+ const id = asString(record2.id);
10308
10415
  if (!id) return void 0;
10309
10416
  return {
10310
- ...clone2(record),
10417
+ ...clone2(record2),
10311
10418
  id,
10312
- order_id: asString(record.order_id) ?? orderId,
10313
- user_id: asString(record.user_id) ?? userId
10419
+ order_id: asString(record2.order_id) ?? orderId,
10420
+ user_id: asString(record2.user_id) ?? userId
10314
10421
  };
10315
10422
  };
10316
10423
  var demographicsFromOrder = (order) => {
@@ -10372,16 +10479,16 @@ var expectedFromMarkersResponse = async (source, test) => {
10372
10479
  const expected = [];
10373
10480
  const cleaned = [];
10374
10481
  for (const entry of markers) {
10375
- const record = asRecord(entry);
10376
- if (!record) continue;
10377
- const expectedField = record.expected_results;
10482
+ const record2 = asRecord(entry);
10483
+ if (!record2) continue;
10484
+ const expectedField = record2.expected_results;
10378
10485
  if (Array.isArray(expectedField) && expectedField.length > 0 && expected.length === 0) {
10379
10486
  for (const item of expectedField) {
10380
10487
  const expectedRecord = asRecord(item);
10381
10488
  if (expectedRecord) expected.push(clone2(expectedRecord));
10382
10489
  }
10383
10490
  }
10384
- const { expected_results: _ignored, ...rest } = record;
10491
+ const { expected_results: _ignored, ...rest } = record2;
10385
10492
  cleaned.push(rest);
10386
10493
  }
10387
10494
  test.markers = cleaned;
@@ -11692,10 +11799,10 @@ var listOf = (body) => {
11692
11799
  return Array.isArray(items) ? items.map(asRecord2).filter((entry) => !!entry) : [];
11693
11800
  };
11694
11801
  var canonicalJson = (value) => JSON.stringify(value, (_key, inner) => {
11695
- const record = asRecord2(inner);
11696
- if (!record) return inner;
11802
+ const record2 = asRecord2(inner);
11803
+ if (!record2) return inner;
11697
11804
  return Object.fromEntries(
11698
- Object.keys(record).sort().map((key) => [key, record[key]])
11805
+ Object.keys(record2).sort().map((key) => [key, record2[key]])
11699
11806
  );
11700
11807
  });
11701
11808
  var fingerprintCorpus = async (corpus) => {
@@ -11900,7 +12007,7 @@ var createWebhookDispatcher = (endpoint) => {
11900
12007
  const body = JSON.stringify(delivery.event);
11901
12008
  const timestamp = Math.floor(now() / 1e3);
11902
12009
  const started = now();
11903
- const record = {
12010
+ const record2 = {
11904
12011
  attempt: delivery.attempts.length + 1,
11905
12012
  at: new Date(started).toISOString(),
11906
12013
  status: null,
@@ -11924,16 +12031,16 @@ var createWebhookDispatcher = (endpoint) => {
11924
12031
  signal: controller.signal
11925
12032
  })
11926
12033
  );
11927
- record.status = response.status;
12034
+ record2.status = response.status;
11928
12035
  await response.body?.cancel();
11929
12036
  } catch (error) {
11930
- record.error = controller.signal.aborted ? `timed out after ${timeoutMs}ms` : error instanceof Error ? error.message : String(error);
12037
+ record2.error = controller.signal.aborted ? `timed out after ${timeoutMs}ms` : error instanceof Error ? error.message : String(error);
11931
12038
  } finally {
11932
12039
  cancel(timer);
11933
- record.durationMs = now() - started;
11934
- delivery.attempts.push(record);
12040
+ record2.durationMs = now() - started;
12041
+ delivery.attempts.push(record2);
11935
12042
  }
11936
- return record.status !== null && record.status >= 200 && record.status < 300;
12043
+ return record2.status !== null && record2.status >= 200 && record2.status < 300;
11937
12044
  };
11938
12045
  const track = (work) => {
11939
12046
  inFlight.add(work);
@@ -12019,6 +12126,8 @@ var createWebhookDispatcher = (endpoint) => {
12019
12126
 
12020
12127
  // src/runtime.ts
12021
12128
  var createRuntime2 = (options = {}) => {
12129
+ if (options.labAccountBehavior)
12130
+ labAccountBehaviorFrom({ profile: "native", ...options.labAccountBehavior });
12022
12131
  const webhooks = options.webhooks ? createWebhookDispatcher(options.webhooks) : void 0;
12023
12132
  const runtime = createRuntime({
12024
12133
  name: JUNCTION_NAMESPACE,
@@ -12041,6 +12150,7 @@ var createRuntime2 = (options = {}) => {
12041
12150
  ...options.geo ? { geo: options.geo } : {},
12042
12151
  ...options.labAccounts ? { labAccounts: options.labAccounts } : {},
12043
12152
  ...options.labAccountOmissionPolicies ? { labAccountOmissionPolicies: options.labAccountOmissionPolicies } : {},
12153
+ ...options.labAccountBehavior ? { labAccountBehavior: options.labAccountBehavior } : {},
12044
12154
  ...options.teamId !== void 0 ? { teamId: options.teamId } : {},
12045
12155
  ...options.limits ? { limits: options.limits } : {},
12046
12156
  ...options.identity ? { identity: options.identity } : {},
@@ -12086,9 +12196,9 @@ var shapeOf = (value) => {
12086
12196
  if (value === null) return "null";
12087
12197
  if (Array.isArray(value)) return value.length === 0 ? [] : [shapeOf(value[0])];
12088
12198
  if (typeof value === "object") {
12089
- const record = value;
12199
+ const record2 = value;
12090
12200
  return Object.fromEntries(
12091
- Object.keys(record).sort().map((key) => [key, shapeOf(record[key])])
12201
+ Object.keys(record2).sort().map((key) => [key, shapeOf(record2[key])])
12092
12202
  );
12093
12203
  }
12094
12204
  return typeof value;
@@ -12586,6 +12696,10 @@ var JunctionAPI = class {
12586
12696
  if (options.identity !== void 0 && !IDENTITY_MODES.includes(options.identity))
12587
12697
  throw new TypeError(`identity must be one of ${IDENTITY_MODES.join(", ")}`);
12588
12698
  state.identity = options.identity ?? "strict";
12699
+ state.labAccountBehavior = labAccountBehaviorFrom({
12700
+ profile: "native",
12701
+ ...options.labAccountBehavior
12702
+ });
12589
12703
  state.defaultBillingTypes = defaultBillingTypesFrom(options.defaultBillingTypes ?? {});
12590
12704
  state.labAccountOmissionPolicies = omissionPoliciesFrom(
12591
12705
  options.labAccountOmissionPolicies ?? {}
@@ -12689,18 +12803,18 @@ var JunctionAPI = class {
12689
12803
  }
12690
12804
  /** Add one account. Throws `LabAccountConflict` when the id is taken. Kept across resets. */
12691
12805
  addLabAccount(input) {
12692
- const record = labAccountFromInput(input, this.state.teamId);
12693
- if (this.state.labAccounts.has(record.id)) throw new LabAccountConflict(record.id);
12694
- this.editLabAccounts((accounts) => [...accounts, record]);
12695
- return record;
12806
+ const record2 = labAccountFromInput(input, this.state.teamId);
12807
+ if (this.state.labAccounts.has(record2.id)) throw new LabAccountConflict(record2.id);
12808
+ this.editLabAccounts((accounts) => [...accounts, record2]);
12809
+ return record2;
12696
12810
  }
12697
12811
  /** Add a named preset (see `LAB_ACCOUNT_PRESETS`); `undefined` for an unknown name. */
12698
12812
  addLabAccountPreset(name2, id) {
12699
- const record = labAccountFromPreset(name2, {
12813
+ const record2 = labAccountFromPreset(name2, {
12700
12814
  teamId: this.state.teamId,
12701
12815
  ...id !== void 0 ? { id } : {}
12702
12816
  });
12703
- return record ? this.addLabAccount(record) : void 0;
12817
+ return record2 ? this.addLabAccount(record2) : void 0;
12704
12818
  }
12705
12819
  /** Merge fields into an account; `undefined` when there is none with that id. */
12706
12820
  patchLabAccount(id, patch) {
@@ -12731,7 +12845,13 @@ var JunctionAPI = class {
12731
12845
  set labAccountOmissionPolicies(input) {
12732
12846
  this.state.labAccountOmissionPolicies = omissionPoliciesFrom(input);
12733
12847
  }
12734
- /** Lab slug → the billing type an order gets when omitted. Kept across reset. */
12848
+ /** Effective account policy for this namespace; kept across reset. */
12849
+ get labAccountBehavior() {
12850
+ return labAccountBehaviorFrom(this.state.labAccountBehavior);
12851
+ }
12852
+ set labAccountBehavior(input) {
12853
+ this.state.labAccountBehavior = labAccountBehaviorFrom(input);
12854
+ }
12735
12855
  get defaultBillingTypes() {
12736
12856
  return { ...this.state.defaultBillingTypes };
12737
12857
  }
@@ -12954,6 +13074,7 @@ export {
12954
13074
  TEAM_LAB_ACCOUNTS,
12955
13075
  isLinkedToTeam,
12956
13076
  labAccountFromInput,
13077
+ labAccountBehaviorFrom,
12957
13078
  PLATFORM_ACCOUNT_STATES,
12958
13079
  DELEGATED_ACCOUNT_STATES,
12959
13080
  LAB_ACCOUNT_PRESETS,
@@ -12997,4 +13118,4 @@ export {
12997
13118
  JunctionAPI,
12998
13119
  LabAccountConflict
12999
13120
  };
13000
- //# sourceMappingURL=chunk-KMCP67GK.js.map
13121
+ //# sourceMappingURL=chunk-VHVGQ3WX.js.map