@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.cjs +93 -0
- package/dist/index.d.cts +400 -101
- package/dist/index.d.ts +400 -101
- package/dist/index.js +93 -0
- package/docs/clients/PatientClient.md +2 -0
- package/docs/docs-manifest.json +10 -3
- package/docs/examples/index.md +2 -0
- package/docs/index.md +2 -0
- package/docs/models/IntakeOperationError.md +18 -0
- package/docs/models/IntakeOperationResponse.md +22 -0
- package/docs/models/ObservedIntakeResponse.md +17 -0
- package/docs/models/SubmitIntakeOperationRequest.md +19 -0
- package/docs/models/UnknownIntakeOperation.md +18 -0
- package/docs/models/index.md +5 -0
- package/docs/operations/patient.getPatientIntakeOperation.md +166 -0
- package/docs/operations/patient.submitPatientIntakeOperation.md +178 -0
- package/package.json +1 -1
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
# Execute or replay one keyed agent intake operation
|
|
2
|
+
|
|
3
|
+
Operation ID: `patient.submitPatientIntakeOperation`
|
|
4
|
+
|
|
5
|
+
Derives tenant/patient from patient login and binds the key to exact raw section/summary. A committed first-dispatch marker precedes the shared intake pipeline. Existing pending/unknown keys return HTTP 202 without repeating writes; recorded responses replay under HTTP 200 with their original response_code/body. Recorded is not independent proof that every clinical effect succeeded. Requires a separately provisioned operation journal; fails closed without it.
|
|
6
|
+
|
|
7
|
+
## Public method
|
|
8
|
+
|
|
9
|
+
`submitPatientIntakeOperation`
|
|
10
|
+
|
|
11
|
+
Signature: `patient.submitPatientIntakeOperation(request)`
|
|
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
|
+
`POST /patients/intake/operations`
|
|
28
|
+
|
|
29
|
+
## Path parameters
|
|
30
|
+
|
|
31
|
+
None.
|
|
32
|
+
|
|
33
|
+
## Query parameters
|
|
34
|
+
|
|
35
|
+
None.
|
|
36
|
+
|
|
37
|
+
## Body parameters
|
|
38
|
+
|
|
39
|
+
| Name | Type | Required | Format | Allowed values | Default | Nullable | Description |
|
|
40
|
+
|---|---|---:|---|---|---|---:|---|
|
|
41
|
+
| `body` | [`SubmitIntakeOperationRequest`](../models/SubmitIntakeOperationRequest.md) | Yes | | | | No | |
|
|
42
|
+
|
|
43
|
+
Request model: [`SubmitIntakeOperationRequest`](../models/SubmitIntakeOperationRequest.md)
|
|
44
|
+
|
|
45
|
+
## Request example
|
|
46
|
+
|
|
47
|
+
```json
|
|
48
|
+
{
|
|
49
|
+
"idempotency_key": "940be5cc-c1fd-4b38-ae7d-13516f9ac098",
|
|
50
|
+
"section": "allergies",
|
|
51
|
+
"summary": "Synthetic intake note."
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Success responses
|
|
56
|
+
|
|
57
|
+
| Status | Shape | Content type | Description |
|
|
58
|
+
|---|---|---|---|
|
|
59
|
+
| `200` | [`IntakeOperationResponse`](../models/IntakeOperationResponse.md) | application/json | Scope/key-bound journal state; recorded HTTP response is not independent clinical success evidence |
|
|
60
|
+
| `202` | [`IntakeOperationResponse`](../models/IntakeOperationResponse.md) | application/json | Scope/key-bound journal state; recorded HTTP response is not independent clinical success evidence |
|
|
61
|
+
|
|
62
|
+
## Success response examples
|
|
63
|
+
|
|
64
|
+
### 200
|
|
65
|
+
|
|
66
|
+
```json
|
|
67
|
+
{
|
|
68
|
+
"idempotency_key": "940be5cc-c1fd-4b38-ae7d-13516f9ac098",
|
|
69
|
+
"patient_id": "patient-example-001",
|
|
70
|
+
"request_hash": "a7c3a0a2f1d949380f4312a44f9a4a02b0ab754a47fc57f10c92a6f8fb5cd544",
|
|
71
|
+
"response_body": {
|
|
72
|
+
"error_messages": [
|
|
73
|
+
"Synthetic outcome needs clinical reconciliation"
|
|
74
|
+
]
|
|
75
|
+
},
|
|
76
|
+
"response_code": 502,
|
|
77
|
+
"status": "recorded"
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Common errors
|
|
82
|
+
|
|
83
|
+
| Status | Shape | Content type | Description |
|
|
84
|
+
|---|---|---|---|
|
|
85
|
+
| `401` | [`IntakeOperationError`](../models/IntakeOperationError.md) | application/json | Patient login required |
|
|
86
|
+
| `403` | [`IntakeOperationError`](../models/IntakeOperationError.md) | application/json | Verified tenant required |
|
|
87
|
+
| `404` | [`IntakeOperationError`](../models/IntakeOperationError.md) | application/json | Patient or operation not found; an in-flight operation may still commit |
|
|
88
|
+
| `409` | [`IntakeOperationError`](../models/IntakeOperationError.md) | application/json | Key already bound to different raw terms |
|
|
89
|
+
| `422` | [`IntakeOperationError`](../models/IntakeOperationError.md) | application/json | Invalid key or intake terms |
|
|
90
|
+
| `503` | [`IntakeOperationError`](../models/IntakeOperationError.md) | application/json | Coordination or outcome unavailable; look up the original key, never fall back to an unkeyed write |
|
|
91
|
+
|
|
92
|
+
## Error examples
|
|
93
|
+
|
|
94
|
+
### 401
|
|
95
|
+
|
|
96
|
+
```json
|
|
97
|
+
{
|
|
98
|
+
"error": "string"
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### 403
|
|
103
|
+
|
|
104
|
+
```json
|
|
105
|
+
{
|
|
106
|
+
"error": "string"
|
|
107
|
+
}
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### 404
|
|
111
|
+
|
|
112
|
+
```json
|
|
113
|
+
{
|
|
114
|
+
"error": "string"
|
|
115
|
+
}
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### 409
|
|
119
|
+
|
|
120
|
+
```json
|
|
121
|
+
{
|
|
122
|
+
"error": "string"
|
|
123
|
+
}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### 422
|
|
127
|
+
|
|
128
|
+
```json
|
|
129
|
+
{
|
|
130
|
+
"error": "string"
|
|
131
|
+
}
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### 503
|
|
135
|
+
|
|
136
|
+
```json
|
|
137
|
+
{
|
|
138
|
+
"error": "string"
|
|
139
|
+
}
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
## NodeJS / TypeScript implementation
|
|
143
|
+
|
|
144
|
+
```ts
|
|
145
|
+
import { HCSDK } from "@healthcloudai/hc-sdk";
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
```ts
|
|
149
|
+
const request = {
|
|
150
|
+
"idempotency_key": "940be5cc-c1fd-4b38-ae7d-13516f9ac098",
|
|
151
|
+
"section": "allergies",
|
|
152
|
+
"summary": "Synthetic intake note."
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
const result = await patient.submitPatientIntakeOperation(request);
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## cURL
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
curl -X POST \
|
|
162
|
+
-H 'Authorization: Bearer <ACCESS_TOKEN>' \
|
|
163
|
+
-H 'Content-Type: application/json' \
|
|
164
|
+
-d '{"idempotency_key":"940be5cc-c1fd-4b38-ae7d-13516f9ac098","section":"allergies","summary":"Synthetic intake note."}' \
|
|
165
|
+
'https://dev-api-patient.health.cloud/patients/intake/operations'
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
## Notes
|
|
169
|
+
|
|
170
|
+
None.
|
|
171
|
+
|
|
172
|
+
## Prepared Test Console scenario
|
|
173
|
+
|
|
174
|
+
No canonical scenario is currently associated.
|
|
175
|
+
|
|
176
|
+
## Real response
|
|
177
|
+
|
|
178
|
+
No approved real integration response is currently published. Unapproved candidates are never rendered as examples.
|
package/package.json
CHANGED