@healthcloudai/hc-sdk 3.20.0 → 3.21.0

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.
package/dist/index.js CHANGED
@@ -935,6 +935,85 @@ var MCPClient = class extends BaseServiceClient {
935
935
  }
936
936
  };
937
937
 
938
+ // src/models/openapi-generated/patient/models/ObservedIntakeResponse.ts
939
+ function ObservedIntakeResponseFromJSON(json) {
940
+ return ObservedIntakeResponseFromJSONTyped(json, false);
941
+ }
942
+ function ObservedIntakeResponseFromJSONTyped(json, ignoreDiscriminator) {
943
+ if (json == null) {
944
+ return json;
945
+ }
946
+ return {
947
+ "error_messages": json["error_messages"]
948
+ };
949
+ }
950
+
951
+ // src/models/openapi-generated/patient/models/IntakeOperationResponse.ts
952
+ function IntakeOperationResponseFromJSON(json) {
953
+ return IntakeOperationResponseFromJSONTyped(json, false);
954
+ }
955
+ function IntakeOperationResponseFromJSONTyped(json, ignoreDiscriminator) {
956
+ if (json == null) {
957
+ return json;
958
+ }
959
+ return {
960
+ "idempotency_key": json["idempotency_key"],
961
+ "patient_id": json["patient_id"],
962
+ "request_hash": json["request_hash"],
963
+ "response_body": json["response_body"] === void 0 ? void 0 : json["response_body"] === null ? null : ObservedIntakeResponseFromJSON(json["response_body"]),
964
+ "response_code": json["response_code"] === void 0 ? void 0 : json["response_code"] === null ? null : json["response_code"],
965
+ "status": json["status"]
966
+ };
967
+ }
968
+
969
+ // src/clients/intakeOperations.ts
970
+ var sections = /* @__PURE__ */ new Set(["allergies", "cancer_cases", "family_history", "gyn_history", "perinatal_history", "medications", "problems", "social_history", "surgical_history", "vaccines"]);
971
+ var record = (value) => !!value && typeof value === "object" && !Array.isArray(value);
972
+ function intakeOperationKey(key) {
973
+ if (typeof key !== "string" || key.length !== 36 || !/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/.test(key)) {
974
+ throw new Error("A canonical UUID operation key is required");
975
+ }
976
+ return key;
977
+ }
978
+ function intakeRequestSnapshot(request) {
979
+ const invalid = () => new Error("Valid bounded raw intake terms are required");
980
+ if (!record(request) || Object.keys(request).sort().join(",") !== "idempotency_key,section,summary") throw invalid();
981
+ const key = intakeOperationKey(request.idempotency_key);
982
+ if (!sections.has(request.section)) throw invalid();
983
+ const raw = request.summary;
984
+ if (typeof raw === "string" ? !raw.trim() : !record(raw) || Object.keys(raw).length !== 1 || !Object.prototype.hasOwnProperty.call(raw, request.section)) throw invalid();
985
+ let visited = 0;
986
+ function snapshot(value, depth) {
987
+ if (depth > 16 || ++visited > 65536) throw invalid();
988
+ if (value === null || typeof value === "string" || typeof value === "boolean") return value;
989
+ if (typeof value === "number" && Number.isFinite(value)) return value;
990
+ if (!value || typeof value !== "object" || Object.getOwnPropertySymbols(value).length) throw invalid();
991
+ const array = Array.isArray(value);
992
+ if (!array && Object.getPrototypeOf(value) !== Object.prototype && Object.getPrototypeOf(value) !== null) throw invalid();
993
+ const names = Object.getOwnPropertyNames(value).filter((name) => !(array && name === "length"));
994
+ if (array && (names.length !== value.length || names.some((name, index) => name !== String(index)))) throw invalid();
995
+ const entries = names.map((name) => {
996
+ const descriptor = Object.getOwnPropertyDescriptor(value, name);
997
+ if (!descriptor.enumerable || !("value" in descriptor)) throw invalid();
998
+ return [name, snapshot(descriptor.value, depth + 1)];
999
+ });
1000
+ return array ? entries.map(([, item]) => item) : Object.fromEntries(entries);
1001
+ }
1002
+ const summary = snapshot(raw, 0);
1003
+ if (new TextEncoder().encode(JSON.stringify(summary)).length > 65536) throw invalid();
1004
+ return { idempotency_key: key, section: request.section, summary };
1005
+ }
1006
+ function intakeOperationResponse(value, key) {
1007
+ const invalid = () => new Error("Invalid or mismatched intake operation response; reconcile the original key");
1008
+ const required = ["idempotency_key", "patient_id", "request_hash", "status"];
1009
+ if (!record(value) || required.some((name) => !Object.prototype.hasOwnProperty.call(value, name)) || Object.keys(value).some((name) => ![...required, "response_code", "response_body"].includes(name)) || value.idempotency_key !== key || typeof value.patient_id !== "string" || value.patient_id.length > 64 || !/^[A-Za-z0-9.-]+$/.test(value.patient_id) || value.patient_id.trim() !== value.patient_id || typeof value.request_hash !== "string" || value.request_hash.length !== 64 || !/^[0-9a-f]{64}$/.test(value.request_hash) || typeof value.status !== "string" || !["reserved", "dispatching", "unknown", "recorded"].includes(value.status)) throw invalid();
1010
+ const code = value.response_code, body = value.response_body;
1011
+ if (value.status === "recorded") {
1012
+ if (typeof code !== "number" || !Number.isInteger(code) || code < 100 || code > 599 || !record(body) || Object.keys(body).join(",") !== "error_messages" || !Array.isArray(body.error_messages) || body.error_messages.length > 100 || body.error_messages.some((item) => typeof item !== "string" || Array.from(item).length > 4e3)) throw invalid();
1013
+ } else if (code != null || body != null) throw invalid();
1014
+ return IntakeOperationResponseFromJSON(value);
1015
+ }
1016
+
938
1017
  // src/models/openapi-generated/patient/models/StediClaimsResponse.ts
939
1018
  function StediClaimsResponseFromJSON(json) {
940
1019
  return StediClaimsResponseFromJSONTyped(json, false);
@@ -2805,6 +2884,20 @@ var PatientClient = class extends BaseServiceClient {
2805
2884
  body: payload
2806
2885
  });
2807
2886
  }
2887
+ /** Submit exact approved terms once. Pending/unknown remains unresolved;
2888
+ * recorded HTTP evidence is not independent proof of clinical success.
2889
+ * After transport failure, look up the original key. No retries or fallback.
2890
+ */
2891
+ async submitPatientIntakeOperation(request) {
2892
+ const body = intakeRequestSnapshot(request);
2893
+ const response = await this.send("POST", "/patients/intake/operations", { body });
2894
+ return intakeOperationResponse(response, body.idempotency_key);
2895
+ }
2896
+ /** Read the original key without writing. A 404 does not prove no effect. */
2897
+ async getPatientIntakeOperation(idempotencyKey) {
2898
+ const key = intakeOperationKey(idempotencyKey);
2899
+ return intakeOperationResponse(await this.send("GET", `/patients/intake/operations/${key}`), key);
2900
+ }
2808
2901
  /** GET /patients/attributes - get the authenticated patient's arbitrary JSON attributes. */
2809
2902
  getAttributes() {
2810
2903
  return this.send("GET", "/patients/attributes", {});
@@ -56,6 +56,7 @@
56
56
  - [`getFlags`](../operations/patient.getPatientFlags.md) — Get patient flags
57
57
  - [`getPatientFlagsOperation`](../operations/patient.getPatientFlagsOperation.md) — Look up a keyed patient flag receipt
58
58
  - [`getPatientIntake`](../operations/patient.getPatientIntake.md) — Get own patient intake submission and delivery status
59
+ - [`getPatientIntakeOperation`](../operations/patient.getPatientIntakeOperation.md) — Read the logged-in patient's keyed intake journal state
59
60
  - [`getPatientSidebar`](../operations/patient.getPatientSidebarPatientSidebar.md) — Get the patient sidebar summary
60
61
  - [`getPhoto`](../operations/patient.getPhoto.md) — Get a patient photo
61
62
  - [`getPreferredPharmacy`](../operations/patient.getPreferredPharmacy.md) — Get preferred pharmacy
@@ -86,6 +87,7 @@
86
87
  - [`setPreferredPharmacy`](../operations/patient.setPreferredPharmacy.md) — Set preferred pharmacy
87
88
  - [`createCurrentScreeningSymptoms`](../operations/patient.submitCurrentSymptomsScreeningsCurrentSymptoms.md) — Submit current symptoms
88
89
  - [`submitPatientIntake`](../operations/patient.submitPatientIntake.md) — Submit patient-reported health record intake
90
+ - [`submitPatientIntakeOperation`](../operations/patient.submitPatientIntakeOperation.md) — Execute or replay one keyed agent intake operation
89
91
  - [`submitRawX12InsuranceEligibility`](../operations/patient.submitPatientRawX12Eligibility.md) — Submit a raw X12 270 eligibility request
90
92
  - [`submitSummary`](../operations/patient.submitSummary.md) — Write raw conversation/summary text onto an encounter's FHIR notes and, when Athena-linked, Athena's Reason for Visit/Screening/HPI sections
91
93
  - [`updateAddress`](../operations/patient.updateAddress.md) — Update home address
@@ -1,5 +1,5 @@
1
1
  {
2
- "docsDataContentDigest": "sha256:8a885adeb4993c883d40ab90cd4b3c96f57da4d28661ca356427847752e9508e",
2
+ "docsDataContentDigest": "sha256:88a0aadd3400544fa7395dfe762aa6d04c595a8e2109855a7d9e58221f8fe0cb",
3
3
  "generatedFiles": [
4
4
  "authentication.md",
5
5
  "clients/AmsClient.md",
@@ -1214,6 +1214,8 @@
1214
1214
  "models/InitHealthRecordImportResponse.md",
1215
1215
  "models/Insurance.md",
1216
1216
  "models/InsurancePriority.md",
1217
+ "models/IntakeOperationError.md",
1218
+ "models/IntakeOperationResponse.md",
1217
1219
  "models/InterpretationCode.md",
1218
1220
  "models/IntoleranceType.md",
1219
1221
  "models/IntraocularPressure.md",
@@ -1300,6 +1302,7 @@
1300
1302
  "models/NppesVerifyProviderResponse.md",
1301
1303
  "models/ObservationComponent.md",
1302
1304
  "models/ObservationStatus.md",
1305
+ "models/ObservedIntakeResponse.md",
1303
1306
  "models/OnboardEncounterPayload.md",
1304
1307
  "models/OnboardEncounterStepResult.md",
1305
1308
  "models/OnboardPatientAttributes.md",
@@ -1808,6 +1811,7 @@
1808
1811
  "models/StripeVerifyConnectionResponse.md",
1809
1812
  "models/SubmitCurrentSymptomsScreeningsCurrentSymptomsRequest.md",
1810
1813
  "models/SubmitCurrentSymptomsScreeningsCurrentSymptomsResponse.md",
1814
+ "models/SubmitIntakeOperationRequest.md",
1811
1815
  "models/SubmitSummaryRequest.md",
1812
1816
  "models/SubscriberRelationship.md",
1813
1817
  "models/SubstanceStatus.md",
@@ -1836,6 +1840,7 @@
1836
1840
  "models/UberUpdateDeliveryRequest.md",
1837
1841
  "models/UberWaypoint.md",
1838
1842
  "models/UnknownFlagOperation.md",
1843
+ "models/UnknownIntakeOperation.md",
1839
1844
  "models/UpdateAddressRequest.md",
1840
1845
  "models/UpdateAddressResponse.md",
1841
1846
  "models/UpdateAgentRequest.md",
@@ -3128,6 +3133,7 @@
3128
3133
  "operations/patient.getPatientFlags.md",
3129
3134
  "operations/patient.getPatientFlagsOperation.md",
3130
3135
  "operations/patient.getPatientIntake.md",
3136
+ "operations/patient.getPatientIntakeOperation.md",
3131
3137
  "operations/patient.getPatientSidebarPatientSidebar.md",
3132
3138
  "operations/patient.getPhoto.md",
3133
3139
  "operations/patient.getPreferredPharmacy.md",
@@ -3163,6 +3169,7 @@
3163
3169
  "operations/patient.setPreferredPharmacy.md",
3164
3170
  "operations/patient.submitCurrentSymptomsScreeningsCurrentSymptoms.md",
3165
3171
  "operations/patient.submitPatientIntake.md",
3172
+ "operations/patient.submitPatientIntakeOperation.md",
3166
3173
  "operations/patient.submitPatientRawX12Eligibility.md",
3167
3174
  "operations/patient.submitSummary.md",
3168
3175
  "operations/patient.updateAddress.md",
@@ -3235,7 +3242,7 @@
3235
3242
  "operations/vitals.recordVitals.md"
3236
3243
  ],
3237
3244
  "language": "nodejs",
3238
- "modelCount": 2128,
3239
- "operationCount": 1050,
3245
+ "modelCount": 2133,
3246
+ "operationCount": 1052,
3240
3247
  "schemaVersion": 1
3241
3248
  }
@@ -947,6 +947,7 @@ Generated call examples use exact public surface signatures. Workflow examples r
947
947
  - [Get patient flags](../operations/patient.getPatientFlags.md)
948
948
  - [Look up a keyed patient flag receipt](../operations/patient.getPatientFlagsOperation.md)
949
949
  - [Get own patient intake submission and delivery status](../operations/patient.getPatientIntake.md)
950
+ - [Read the logged-in patient's keyed intake journal state](../operations/patient.getPatientIntakeOperation.md)
950
951
  - [Get the patient sidebar summary](../operations/patient.getPatientSidebarPatientSidebar.md)
951
952
  - [Get a patient photo](../operations/patient.getPhoto.md)
952
953
  - [Get preferred pharmacy](../operations/patient.getPreferredPharmacy.md)
@@ -982,6 +983,7 @@ Generated call examples use exact public surface signatures. Workflow examples r
982
983
  - [Set preferred pharmacy](../operations/patient.setPreferredPharmacy.md)
983
984
  - [Submit current symptoms](../operations/patient.submitCurrentSymptomsScreeningsCurrentSymptoms.md)
984
985
  - [Submit patient-reported health record intake](../operations/patient.submitPatientIntake.md)
986
+ - [Execute or replay one keyed agent intake operation](../operations/patient.submitPatientIntakeOperation.md)
985
987
  - [Submit a raw X12 270 eligibility request](../operations/patient.submitPatientRawX12Eligibility.md)
986
988
  - [Write raw conversation/summary text onto an encounter's FHIR notes and, when Athena-linked, Athena's Reason for Visit/Screening/HPI sections](../operations/patient.submitSummary.md)
987
989
  - [Update home address](../operations/patient.updateAddress.md)
package/docs/index.md CHANGED
@@ -955,6 +955,7 @@ This directory is generated from the shared structured docs data. Do not edit ge
955
955
  - [Get patient flags](operations/patient.getPatientFlags.md) (`patient.getPatientFlags`)
956
956
  - [Look up a keyed patient flag receipt](operations/patient.getPatientFlagsOperation.md) (`patient.getPatientFlagsOperation`)
957
957
  - [Get own patient intake submission and delivery status](operations/patient.getPatientIntake.md) (`patient.getPatientIntake`)
958
+ - [Read the logged-in patient's keyed intake journal state](operations/patient.getPatientIntakeOperation.md) (`patient.getPatientIntakeOperation`)
958
959
  - [Get the patient sidebar summary](operations/patient.getPatientSidebarPatientSidebar.md) (`patient.getPatientSidebarPatientSidebar`)
959
960
  - [Get a patient photo](operations/patient.getPhoto.md) (`patient.getPhoto`)
960
961
  - [Get preferred pharmacy](operations/patient.getPreferredPharmacy.md) (`patient.getPreferredPharmacy`)
@@ -990,6 +991,7 @@ This directory is generated from the shared structured docs data. Do not edit ge
990
991
  - [Set preferred pharmacy](operations/patient.setPreferredPharmacy.md) (`patient.setPreferredPharmacy`)
991
992
  - [Submit current symptoms](operations/patient.submitCurrentSymptomsScreeningsCurrentSymptoms.md) (`patient.submitCurrentSymptomsScreeningsCurrentSymptoms`)
992
993
  - [Submit patient-reported health record intake](operations/patient.submitPatientIntake.md) (`patient.submitPatientIntake`)
994
+ - [Execute or replay one keyed agent intake operation](operations/patient.submitPatientIntakeOperation.md) (`patient.submitPatientIntakeOperation`)
993
995
  - [Submit a raw X12 270 eligibility request](operations/patient.submitPatientRawX12Eligibility.md) (`patient.submitPatientRawX12Eligibility`)
994
996
  - [Write raw conversation/summary text onto an encounter's FHIR notes and, when Athena-linked, Athena's Reason for Visit/Screening/HPI sections](operations/patient.submitSummary.md) (`patient.submitSummary`)
995
997
  - [Update home address](operations/patient.updateAddress.md) (`patient.updateAddress`)
@@ -0,0 +1,18 @@
1
+ # IntakeOperationError
2
+
3
+ Model ID: `IntakeOperationError`
4
+
5
+ No description.
6
+
7
+ Type: `object`
8
+
9
+ ## Fields
10
+
11
+ | Field | Type | Required | Format | Allowed values | Default | Nullable | Description |
12
+ |---|---|---:|---|---|---|---:|---|
13
+ | `error` | `string` | Yes | | | | No | |
14
+ | `outcome` | [`UnknownIntakeOperation`](./UnknownIntakeOperation.md) | No | | | | Yes | |
15
+
16
+ ## Example
17
+
18
+ None declared in canonical OpenAPI.
@@ -0,0 +1,22 @@
1
+ # IntakeOperationResponse
2
+
3
+ Model ID: `IntakeOperationResponse`
4
+
5
+ No description.
6
+
7
+ Type: `object`
8
+
9
+ ## Fields
10
+
11
+ | Field | Type | Required | Format | Allowed values | Default | Nullable | Description |
12
+ |---|---|---:|---|---|---|---:|---|
13
+ | `idempotency_key` | `string` | Yes | | | | No | |
14
+ | `patient_id` | `string` | Yes | | | | No | |
15
+ | `request_hash` | `string` | Yes | | | | No | |
16
+ | `response_body` | [`ObservedIntakeResponse`](./ObservedIntakeResponse.md) | No | | | | Yes | |
17
+ | `response_code` | `integer|null` | No | | | | Yes | |
18
+ | `status` | `string` | Yes | | reserved, dispatching, unknown, recorded | | No | |
19
+
20
+ ## Example
21
+
22
+ None declared in canonical OpenAPI.
@@ -0,0 +1,17 @@
1
+ # ObservedIntakeResponse
2
+
3
+ Model ID: `ObservedIntakeResponse`
4
+
5
+ No description.
6
+
7
+ Type: `object`
8
+
9
+ ## Fields
10
+
11
+ | Field | Type | Required | Format | Allowed values | Default | Nullable | Description |
12
+ |---|---|---:|---|---|---|---:|---|
13
+ | `error_messages` | `array` | Yes | | | | No | |
14
+
15
+ ## Example
16
+
17
+ None declared in canonical OpenAPI.
@@ -0,0 +1,19 @@
1
+ # SubmitIntakeOperationRequest
2
+
3
+ Model ID: `SubmitIntakeOperationRequest`
4
+
5
+ No description.
6
+
7
+ Type: `object`
8
+
9
+ ## Fields
10
+
11
+ | Field | Type | Required | Format | Allowed values | Default | Nullable | Description |
12
+ |---|---|---:|---|---|---|---:|---|
13
+ | `idempotency_key` | `string` | Yes | | | | No | |
14
+ | `section` | `string` | Yes | | allergies, cancer_cases, family_history, gyn_history, perinatal_history, medications, problems, social_history, surgical_history, vaccines | | No | |
15
+ | `summary` | `object|string` | Yes | | | | No | Exact reviewed raw text or matching single-section object. Bounded to 65536 canonical JSON UTF-8 bytes and 16 levels before storage; existing clinical input validation still applies. |
16
+
17
+ ## Example
18
+
19
+ None declared in canonical OpenAPI.
@@ -0,0 +1,18 @@
1
+ # UnknownIntakeOperation
2
+
3
+ Model ID: `UnknownIntakeOperation`
4
+
5
+ No description.
6
+
7
+ Type: `object`
8
+
9
+ ## Fields
10
+
11
+ | Field | Type | Required | Format | Allowed values | Default | Nullable | Description |
12
+ |---|---|---:|---|---|---|---:|---|
13
+ | `idempotency_key` | `string` | Yes | | | | No | |
14
+ | `status` | `string` | No | | | `"unknown"` | No | |
15
+
16
+ ## Example
17
+
18
+ None declared in canonical OpenAPI.
@@ -1216,6 +1216,8 @@
1216
1216
  - [InitHealthRecordImportResponse](InitHealthRecordImportResponse.md)
1217
1217
  - [Insurance](Insurance.md)
1218
1218
  - [InsurancePriority](InsurancePriority.md)
1219
+ - [IntakeOperationError](IntakeOperationError.md)
1220
+ - [IntakeOperationResponse](IntakeOperationResponse.md)
1219
1221
  - [InterpretationCode](InterpretationCode.md)
1220
1222
  - [IntoleranceType](IntoleranceType.md)
1221
1223
  - [IntraocularPressure](IntraocularPressure.md)
@@ -1303,6 +1305,7 @@
1303
1305
  - [NppesVerifyProviderResponse](NppesVerifyProviderResponse.md)
1304
1306
  - [ObservationComponent](ObservationComponent.md)
1305
1307
  - [ObservationStatus](ObservationStatus.md)
1308
+ - [ObservedIntakeResponse](ObservedIntakeResponse.md)
1306
1309
  - [OnboardEncounterPayload](OnboardEncounterPayload.md)
1307
1310
  - [OnboardEncounterStepResult](OnboardEncounterStepResult.md)
1308
1311
  - [OnboardingProgressRequest](OnboardingProgressRequest.md)
@@ -1921,6 +1924,7 @@
1921
1924
  - [StripeVerifyConnectionResponse](StripeVerifyConnectionResponse.md)
1922
1925
  - [SubmitCurrentSymptomsScreeningsCurrentSymptomsRequest](SubmitCurrentSymptomsScreeningsCurrentSymptomsRequest.md)
1923
1926
  - [SubmitCurrentSymptomsResponse](SubmitCurrentSymptomsScreeningsCurrentSymptomsResponse.md)
1927
+ - [SubmitIntakeOperationRequest](SubmitIntakeOperationRequest.md)
1924
1928
  - [SubmitSummaryRequest](SubmitSummaryRequest.md)
1925
1929
  - [SubscriberRelationship](SubscriberRelationship.md)
1926
1930
  - [SubstanceStatus](SubstanceStatus.md)
@@ -1951,6 +1955,7 @@
1951
1955
  - [UberUpdateDeliveryRequest](UberUpdateDeliveryRequest.md)
1952
1956
  - [UberWaypoint](UberWaypoint.md)
1953
1957
  - [UnknownFlagOperation](UnknownFlagOperation.md)
1958
+ - [UnknownIntakeOperation](UnknownIntakeOperation.md)
1954
1959
  - [UpdateAddressRequest](UpdateAddressRequest.md)
1955
1960
  - [UpdateAddressResponse](UpdateAddressResponse.md)
1956
1961
  - [UpdateAgentRequest](UpdateAgentRequest.md)
@@ -0,0 +1,166 @@
1
+ # Read the logged-in patient's keyed intake journal state
2
+
3
+ Operation ID: `patient.getPatientIntakeOperation`
4
+
5
+ Reads the original scope-bound journal entry without executing intake. Missing/pending state is not evidence of failure or permission to repeat a write.
6
+
7
+ ## Public method
8
+
9
+ `getPatientIntakeOperation`
10
+
11
+ Signature: `patient.getPatientIntakeOperation(idempotencyKey)`
12
+
13
+ Return type: `Promise<IntakeOperationResponse>`
14
+
15
+ ## Authentication
16
+
17
+ Classification: **AUTHENTICATED**
18
+
19
+ Schemes: `bearerAuth`
20
+
21
+ ## Prerequisites
22
+
23
+ None documented.
24
+
25
+ ## HTTP
26
+
27
+ `GET /patients/intake/operations/{idempotency_key}`
28
+
29
+ ## Path parameters
30
+
31
+ | Name | Type | Required | Format | Allowed values | Default | Nullable | Description |
32
+ |---|---|---:|---|---|---|---:|---|
33
+ | `idempotency_key` | `string` | Yes | | | | No | |
34
+
35
+ ## Query parameters
36
+
37
+ None.
38
+
39
+ ## Body parameters
40
+
41
+ None.
42
+
43
+ Request model: None.
44
+
45
+ ## Request example
46
+
47
+ None declared in canonical OpenAPI.
48
+
49
+ ## Success responses
50
+
51
+ | Status | Shape | Content type | Description |
52
+ |---|---|---|---|
53
+ | `200` | [`IntakeOperationResponse`](../models/IntakeOperationResponse.md) | application/json | Scope/key-bound journal state; recorded HTTP response is not independent clinical success evidence |
54
+ | `202` | [`IntakeOperationResponse`](../models/IntakeOperationResponse.md) | application/json | Scope/key-bound journal state; recorded HTTP response is not independent clinical success evidence |
55
+
56
+ ## Success response examples
57
+
58
+ ### 200
59
+
60
+ ```json
61
+ {
62
+ "idempotency_key": "940be5cc-c1fd-4b38-ae7d-13516f9ac098",
63
+ "patient_id": "patient-example-001",
64
+ "request_hash": "a7c3a0a2f1d949380f4312a44f9a4a02b0ab754a47fc57f10c92a6f8fb5cd544",
65
+ "response_body": {
66
+ "error_messages": [
67
+ "Synthetic outcome needs clinical reconciliation"
68
+ ]
69
+ },
70
+ "response_code": 502,
71
+ "status": "recorded"
72
+ }
73
+ ```
74
+
75
+ ## Common errors
76
+
77
+ | Status | Shape | Content type | Description |
78
+ |---|---|---|---|
79
+ | `401` | [`IntakeOperationError`](../models/IntakeOperationError.md) | application/json | Patient login required |
80
+ | `403` | [`IntakeOperationError`](../models/IntakeOperationError.md) | application/json | Verified tenant required |
81
+ | `404` | [`IntakeOperationError`](../models/IntakeOperationError.md) | application/json | Patient or operation not found; an in-flight operation may still commit |
82
+ | `409` | [`IntakeOperationError`](../models/IntakeOperationError.md) | application/json | Key already bound to different raw terms |
83
+ | `422` | [`IntakeOperationError`](../models/IntakeOperationError.md) | application/json | Invalid key or intake terms |
84
+ | `503` | [`IntakeOperationError`](../models/IntakeOperationError.md) | application/json | Coordination or outcome unavailable; look up the original key, never fall back to an unkeyed write |
85
+
86
+ ## Error examples
87
+
88
+ ### 401
89
+
90
+ ```json
91
+ {
92
+ "error": "string"
93
+ }
94
+ ```
95
+
96
+ ### 403
97
+
98
+ ```json
99
+ {
100
+ "error": "string"
101
+ }
102
+ ```
103
+
104
+ ### 404
105
+
106
+ ```json
107
+ {
108
+ "error": "string"
109
+ }
110
+ ```
111
+
112
+ ### 409
113
+
114
+ ```json
115
+ {
116
+ "error": "string"
117
+ }
118
+ ```
119
+
120
+ ### 422
121
+
122
+ ```json
123
+ {
124
+ "error": "string"
125
+ }
126
+ ```
127
+
128
+ ### 503
129
+
130
+ ```json
131
+ {
132
+ "error": "string"
133
+ }
134
+ ```
135
+
136
+ ## NodeJS / TypeScript implementation
137
+
138
+ ```ts
139
+ import { HCSDK } from "@healthcloudai/hc-sdk";
140
+ ```
141
+
142
+ ```ts
143
+ const idempotencyKey = "<IDEMPOTENCY_KEY>";
144
+
145
+ const result = await patient.getPatientIntakeOperation(idempotencyKey);
146
+ ```
147
+
148
+ ## cURL
149
+
150
+ ```bash
151
+ curl -X GET \
152
+ -H 'Authorization: Bearer <ACCESS_TOKEN>' \
153
+ 'https://dev-api-patient.health.cloud/patients/intake/operations/%3CIDEMPOTENCY_KEY%3E'
154
+ ```
155
+
156
+ ## Notes
157
+
158
+ None.
159
+
160
+ ## Prepared Test Console scenario
161
+
162
+ No canonical scenario is currently associated.
163
+
164
+ ## Real response
165
+
166
+ No approved real integration response is currently published. Unapproved candidates are never rendered as examples.