@healthcloudai/hc-sdk 3.15.1 → 3.17.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
@@ -1161,6 +1161,36 @@ function CreateEncounterRequestToJSONTyped(value, ignoreDiscriminator = false) {
1161
1161
  };
1162
1162
  }
1163
1163
 
1164
+ // src/models/openapi-generated/patient/models/ApplyPatientFlagsRequest.ts
1165
+ function ApplyPatientFlagsRequestToJSON(json) {
1166
+ return ApplyPatientFlagsRequestToJSONTyped(json, false);
1167
+ }
1168
+ function ApplyPatientFlagsRequestToJSONTyped(value, ignoreDiscriminator = false) {
1169
+ if (value == null) {
1170
+ return value;
1171
+ }
1172
+ return {
1173
+ "flags": value["flags"],
1174
+ "idempotency_key": value["idempotency_key"]
1175
+ };
1176
+ }
1177
+
1178
+ // src/models/openapi-generated/patient/models/FlagOperationReceipt.ts
1179
+ function FlagOperationReceiptFromJSON(json) {
1180
+ return FlagOperationReceiptFromJSONTyped(json, false);
1181
+ }
1182
+ function FlagOperationReceiptFromJSONTyped(json, ignoreDiscriminator) {
1183
+ if (json == null) {
1184
+ return json;
1185
+ }
1186
+ return {
1187
+ "flags": json["flags"],
1188
+ "idempotency_key": json["idempotency_key"],
1189
+ "patient_id": json["patient_id"],
1190
+ "status": json["status"]
1191
+ };
1192
+ }
1193
+
1164
1194
  // src/models/openapi-generated/patient/models/ProcedureStatus.ts
1165
1195
  function ProcedureStatusToJSON(value) {
1166
1196
  return value;
@@ -2614,6 +2644,45 @@ var PatientClient = class extends BaseServiceClient {
2614
2644
  body: request
2615
2645
  });
2616
2646
  }
2647
+ flagOperationKey(key) {
2648
+ 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)) {
2649
+ throw new Error("A canonical UUID operation key is required");
2650
+ }
2651
+ return key;
2652
+ }
2653
+ flagOperationReceipt(value, key, approved) {
2654
+ const invalid = () => new Error("Invalid or mismatched flag operation receipt; reconcile the original key");
2655
+ if (!value || typeof value !== "object" || Array.isArray(value)) throw invalid();
2656
+ const receipt = value;
2657
+ if (Object.keys(receipt).sort().join(",") !== "flags,idempotency_key,patient_id,status" || receipt.idempotency_key !== key || receipt.status !== "applied" || typeof receipt.patient_id !== "string" || receipt.patient_id.trim() !== receipt.patient_id || !/^[A-Za-z0-9.-]{1,64}$/.test(receipt.patient_id) || !receipt.flags || typeof receipt.flags !== "object" || Array.isArray(receipt.flags)) throw invalid();
2658
+ const flags = receipt.flags;
2659
+ if (!Object.keys(flags).length || Object.entries(flags).some(([name, item]) => !name || name.length > 256 || typeof item !== "boolean") || approved && (Object.keys(flags).length !== Object.keys(approved).length || Object.entries(approved).some(([name, item]) => flags[name] !== item))) throw invalid();
2660
+ return FlagOperationReceiptFromJSON(value);
2661
+ }
2662
+ /**
2663
+ * Commit the exact approved flag patch under a stable key. No automatic retries.
2664
+ * After a timeout or unknown outcome, look up the original key before proceeding.
2665
+ * The receipt contains the original patch, even if current flags have changed.
2666
+ */
2667
+ async applyPatientFlagsOperation(request) {
2668
+ const key = this.flagOperationKey(request.idempotency_key);
2669
+ const flags = { ...request.flags };
2670
+ const result = await this.send("POST", "/patients/flags/operations", {
2671
+ body: ApplyPatientFlagsRequestToJSON({ idempotency_key: key, flags })
2672
+ });
2673
+ return this.flagOperationReceipt(result, key, flags);
2674
+ }
2675
+ /**
2676
+ * Read only the authenticated patient's original keyed receipt.
2677
+ * A 404 remains an HTTP error; an in-flight write may still commit.
2678
+ */
2679
+ async getPatientFlagsOperation(idempotencyKey) {
2680
+ const key = this.flagOperationKey(idempotencyKey);
2681
+ const result = await this.send("GET", "/patients/flags/operations/{idempotency_key}", {
2682
+ pathParams: { idempotency_key: key }
2683
+ });
2684
+ return this.flagOperationReceipt(result, key);
2685
+ }
2617
2686
  /** GET /patients — self-service; returns the authenticated patient's own FHIR Patient record. */
2618
2687
  getProfile() {
2619
2688
  return this.send("GET", "/patients", {});
@@ -2708,6 +2777,26 @@ var PatientClient = class extends BaseServiceClient {
2708
2777
  listPatientInsurances() {
2709
2778
  return this.send("GET", "/patients/insurance", {});
2710
2779
  }
2780
+ /** Confirm a change to saved insurance. A pending response is not completion.
2781
+ * Reuse request_id/body for retries; never retry through createInsurance().
2782
+ */
2783
+ replaceInsurance(coverageId, request) {
2784
+ return this.send(
2785
+ "PUT",
2786
+ `/patients/insurance/${encodeURIComponent(coverageId)}`,
2787
+ { body: request }
2788
+ );
2789
+ }
2790
+ /** Retire the exact saved coverage after confirmation. History is retained.
2791
+ * Reuse request_id for retries; pending is not completed removal.
2792
+ */
2793
+ retireInsurance(coverageId, request) {
2794
+ return this.send(
2795
+ "POST",
2796
+ `/patients/insurance/${encodeURIComponent(coverageId)}/retire`,
2797
+ { body: request }
2798
+ );
2799
+ }
2711
2800
  importHealthRecord(payload) {
2712
2801
  return this.send("POST", "/patients/health-record/import", {
2713
2802
  body: payload
@@ -5,6 +5,7 @@
5
5
  - [`saveNotification`](../operations/patient.addNotification.md) — Add a notification
6
6
  - [`addToIntake`](../operations/patient.addPatientIntake.md) — Add one structured patient intake section
7
7
  - [`scanIdentityDocument`](../operations/patient.analyzeIdentityDocument.md) — OCR an identity document
8
+ - [`applyPatientFlagsOperation`](../operations/patient.applyPatientFlagsOperation.md) — Apply a keyed patient flag patch
8
9
  - [`assignImpiloDevice`](../operations/patient.assignImpiloDevice.md) — Assign Impilo device to patient
9
10
  - [`askAssistant`](../operations/patient.assistantChat.md) — Grounded assistant chat
10
11
  - [`classifyVoiceCommand`](../operations/patient.assistantClassify.md) — Classify a voice command into an action code
@@ -53,6 +54,7 @@
53
54
  - [`getAttributes`](../operations/patient.getPatientAttributes.md) — Get patient attributes
54
55
  - [`getDashboard`](../operations/patient.getPatientDashboard.md) — Get the patient dashboard summary
55
56
  - [`getFlags`](../operations/patient.getPatientFlags.md) — Get patient flags
57
+ - [`getPatientFlagsOperation`](../operations/patient.getPatientFlagsOperation.md) — Look up a keyed patient flag receipt
56
58
  - [`getPatientIntake`](../operations/patient.getPatientIntake.md) — Get own patient intake submission and delivery status
57
59
  - [`getPatientSidebar`](../operations/patient.getPatientSidebarPatientSidebar.md) — Get the patient sidebar summary
58
60
  - [`getPhoto`](../operations/patient.getPhoto.md) — Get a patient photo
@@ -78,6 +80,8 @@
78
80
  - [`nearestLocations`](../operations/patient.nearestLocations.md) — Find nearby healthcare locations
79
81
  - [`getPhotoUploadUrl`](../operations/patient.photoUploadUrl.md) — Get a photo upload URL
80
82
  - [`placeTestOrder`](../operations/patient.placeTestOrder.md) — Place a diagnostic test order
83
+ - [`replaceInsurance`](../operations/patient.replaceInsurance.md) — Replace a saved primary self insurance coverage after patient confirmation
84
+ - [`retireInsurance`](../operations/patient.retireInsurance.md) — Retire saved primary self insurance after explicit patient confirmation
81
85
  - [`searchKnowledge`](../operations/patient.searchKnowledge.md) — Search the knowledge base
82
86
  - [`setPreferredPharmacy`](../operations/patient.setPreferredPharmacy.md) — Set preferred pharmacy
83
87
  - [`createCurrentScreeningSymptoms`](../operations/patient.submitCurrentSymptomsScreeningsCurrentSymptoms.md) — Submit current symptoms
@@ -1,5 +1,5 @@
1
1
  {
2
- "docsDataContentDigest": "sha256:57be1634e8f62479ff0bdf4d75acb90286e23c24965f14d7a9bf8c1ccba52d60",
2
+ "docsDataContentDigest": "sha256:2ba44dd2c8b7bc55e158e775cdc5f5f05ef0958ffa56ebf972ceca92449f4db3",
3
3
  "generatedFiles": [
4
4
  "authentication.md",
5
5
  "clients/AmsClient.md",
@@ -83,6 +83,7 @@
83
83
  "models/AppleAuthGenerateClientSecretRequest.md",
84
84
  "models/AppleAuthGenerateClientSecretResponse.md",
85
85
  "models/AppleIdTokenClaims.md",
86
+ "models/ApplyPatientFlagsRequest.md",
86
87
  "models/Appointment.md",
87
88
  "models/AppointmentStatus.md",
88
89
  "models/AssignImpiloDeviceRequest.md",
@@ -588,6 +589,8 @@
588
589
  "models/FedexTrackResult.md",
589
590
  "models/FedexTrackShipmentRequest.md",
590
591
  "models/FieldAgentProfileResponse.md",
592
+ "models/FlagOperationError.md",
593
+ "models/FlagOperationReceipt.md",
591
594
  "models/GS1LookupResponse.md",
592
595
  "models/GS1ParsedData.md",
593
596
  "models/Gender.md",
@@ -1471,10 +1474,14 @@
1471
1474
  "models/RapidTestType.md",
1472
1475
  "models/ReactionSeverity.md",
1473
1476
  "models/RecordVitalsResponse.md",
1477
+ "models/ReplaceInsuranceRequest.md",
1478
+ "models/ReplaceInsuranceResponse.md",
1474
1479
  "models/RescheduleAppointmentRequest.md",
1475
1480
  "models/RespiratoryRate.md",
1476
1481
  "models/ResponseAnswer.md",
1477
1482
  "models/ResponseItem.md",
1483
+ "models/RetireInsuranceRequest.md",
1484
+ "models/RetireInsuranceResponse.md",
1478
1485
  "models/SalesforceAccount.md",
1479
1486
  "models/SalesforceAccountAssets.md",
1480
1487
  "models/SalesforceAddress.md",
@@ -1799,6 +1806,7 @@
1799
1806
  "models/UberGetUndeliveredOrdersResponse.md",
1800
1807
  "models/UberUpdateDeliveryRequest.md",
1801
1808
  "models/UberWaypoint.md",
1809
+ "models/UnknownFlagOperation.md",
1802
1810
  "models/UpdateAddressRequest.md",
1803
1811
  "models/UpdateAddressResponse.md",
1804
1812
  "models/UpdateAgentRequest.md",
@@ -2995,6 +3003,7 @@
2995
3003
  "operations/patient.addNotification.md",
2996
3004
  "operations/patient.addPatientIntake.md",
2997
3005
  "operations/patient.analyzeIdentityDocument.md",
3006
+ "operations/patient.applyPatientFlagsOperation.md",
2998
3007
  "operations/patient.assignImpiloDevice.md",
2999
3008
  "operations/patient.assistantChat.md",
3000
3009
  "operations/patient.assistantClassify.md",
@@ -3044,6 +3053,7 @@
3044
3053
  "operations/patient.getPatientAttributes.md",
3045
3054
  "operations/patient.getPatientDashboard.md",
3046
3055
  "operations/patient.getPatientFlags.md",
3056
+ "operations/patient.getPatientFlagsOperation.md",
3047
3057
  "operations/patient.getPatientIntake.md",
3048
3058
  "operations/patient.getPatientSidebarPatientSidebar.md",
3049
3059
  "operations/patient.getPhoto.md",
@@ -3072,8 +3082,10 @@
3072
3082
  "operations/patient.placeTestOrder.md",
3073
3083
  "operations/patient.refreshToken.md",
3074
3084
  "operations/patient.register.md",
3085
+ "operations/patient.replaceInsurance.md",
3075
3086
  "operations/patient.resendVerificationCode.md",
3076
3087
  "operations/patient.resetPassword.md",
3088
+ "operations/patient.retireInsurance.md",
3077
3089
  "operations/patient.searchKnowledge.md",
3078
3090
  "operations/patient.setPreferredPharmacy.md",
3079
3091
  "operations/patient.submitCurrentSymptomsScreeningsCurrentSymptoms.md",
@@ -3140,7 +3152,7 @@
3140
3152
  "operations/vitals.recordVitals.md"
3141
3153
  ],
3142
3154
  "language": "nodejs",
3143
- "modelCount": 2047,
3144
- "operationCount": 1036,
3155
+ "modelCount": 2055,
3156
+ "operationCount": 1040,
3145
3157
  "schemaVersion": 1
3146
3158
  }
@@ -895,6 +895,7 @@ Generated call examples use exact public surface signatures. Workflow examples r
895
895
  - [Add a notification](../operations/patient.addNotification.md)
896
896
  - [Add one structured patient intake section](../operations/patient.addPatientIntake.md)
897
897
  - [OCR an identity document](../operations/patient.analyzeIdentityDocument.md)
898
+ - [Apply a keyed patient flag patch](../operations/patient.applyPatientFlagsOperation.md)
898
899
  - [Assign Impilo device to patient](../operations/patient.assignImpiloDevice.md)
899
900
  - [Grounded assistant chat](../operations/patient.assistantChat.md)
900
901
  - [Classify a voice command into an action code](../operations/patient.assistantClassify.md)
@@ -944,6 +945,7 @@ Generated call examples use exact public surface signatures. Workflow examples r
944
945
  - [Get patient attributes](../operations/patient.getPatientAttributes.md)
945
946
  - [Get the patient dashboard summary](../operations/patient.getPatientDashboard.md)
946
947
  - [Get patient flags](../operations/patient.getPatientFlags.md)
948
+ - [Look up a keyed patient flag receipt](../operations/patient.getPatientFlagsOperation.md)
947
949
  - [Get own patient intake submission and delivery status](../operations/patient.getPatientIntake.md)
948
950
  - [Get the patient sidebar summary](../operations/patient.getPatientSidebarPatientSidebar.md)
949
951
  - [Get a patient photo](../operations/patient.getPhoto.md)
@@ -972,8 +974,10 @@ Generated call examples use exact public surface signatures. Workflow examples r
972
974
  - [Place a diagnostic test order](../operations/patient.placeTestOrder.md)
973
975
  - [Refresh patient access tokens](../operations/patient.refreshToken.md)
974
976
  - [Register a new patient](../operations/patient.register.md)
977
+ - [Replace a saved primary self insurance coverage after patient confirmation](../operations/patient.replaceInsurance.md)
975
978
  - [Resend the email verification OTP](../operations/patient.resendVerificationCode.md)
976
979
  - [Start a password reset](../operations/patient.resetPassword.md)
980
+ - [Retire saved primary self insurance after explicit patient confirmation](../operations/patient.retireInsurance.md)
977
981
  - [Search the knowledge base](../operations/patient.searchKnowledge.md)
978
982
  - [Set preferred pharmacy](../operations/patient.setPreferredPharmacy.md)
979
983
  - [Submit current symptoms](../operations/patient.submitCurrentSymptomsScreeningsCurrentSymptoms.md)
package/docs/index.md CHANGED
@@ -903,6 +903,7 @@ This directory is generated from the shared structured docs data. Do not edit ge
903
903
  - [Add a notification](operations/patient.addNotification.md) (`patient.addNotification`)
904
904
  - [Add one structured patient intake section](operations/patient.addPatientIntake.md) (`patient.addPatientIntake`)
905
905
  - [OCR an identity document](operations/patient.analyzeIdentityDocument.md) (`patient.analyzeIdentityDocument`)
906
+ - [Apply a keyed patient flag patch](operations/patient.applyPatientFlagsOperation.md) (`patient.applyPatientFlagsOperation`)
906
907
  - [Assign Impilo device to patient](operations/patient.assignImpiloDevice.md) (`patient.assignImpiloDevice`)
907
908
  - [Grounded assistant chat](operations/patient.assistantChat.md) (`patient.assistantChat`)
908
909
  - [Classify a voice command into an action code](operations/patient.assistantClassify.md) (`patient.assistantClassify`)
@@ -952,6 +953,7 @@ This directory is generated from the shared structured docs data. Do not edit ge
952
953
  - [Get patient attributes](operations/patient.getPatientAttributes.md) (`patient.getPatientAttributes`)
953
954
  - [Get the patient dashboard summary](operations/patient.getPatientDashboard.md) (`patient.getPatientDashboard`)
954
955
  - [Get patient flags](operations/patient.getPatientFlags.md) (`patient.getPatientFlags`)
956
+ - [Look up a keyed patient flag receipt](operations/patient.getPatientFlagsOperation.md) (`patient.getPatientFlagsOperation`)
955
957
  - [Get own patient intake submission and delivery status](operations/patient.getPatientIntake.md) (`patient.getPatientIntake`)
956
958
  - [Get the patient sidebar summary](operations/patient.getPatientSidebarPatientSidebar.md) (`patient.getPatientSidebarPatientSidebar`)
957
959
  - [Get a patient photo](operations/patient.getPhoto.md) (`patient.getPhoto`)
@@ -980,8 +982,10 @@ This directory is generated from the shared structured docs data. Do not edit ge
980
982
  - [Place a diagnostic test order](operations/patient.placeTestOrder.md) (`patient.placeTestOrder`)
981
983
  - [Refresh patient access tokens](operations/patient.refreshToken.md) (`patient.refreshToken`)
982
984
  - [Register a new patient](operations/patient.register.md) (`patient.register`)
985
+ - [Replace a saved primary self insurance coverage after patient confirmation](operations/patient.replaceInsurance.md) (`patient.replaceInsurance`)
983
986
  - [Resend the email verification OTP](operations/patient.resendVerificationCode.md) (`patient.resendVerificationCode`)
984
987
  - [Start a password reset](operations/patient.resetPassword.md) (`patient.resetPassword`)
988
+ - [Retire saved primary self insurance after explicit patient confirmation](operations/patient.retireInsurance.md) (`patient.retireInsurance`)
985
989
  - [Search the knowledge base](operations/patient.searchKnowledge.md) (`patient.searchKnowledge`)
986
990
  - [Set preferred pharmacy](operations/patient.setPreferredPharmacy.md) (`patient.setPreferredPharmacy`)
987
991
  - [Submit current symptoms](operations/patient.submitCurrentSymptomsScreeningsCurrentSymptoms.md) (`patient.submitCurrentSymptomsScreeningsCurrentSymptoms`)
@@ -0,0 +1,18 @@
1
+ # ApplyPatientFlagsRequest
2
+
3
+ Model ID: `ApplyPatientFlagsRequest`
4
+
5
+ The exact approved patch; tenant and patient are resolved from login.
6
+
7
+ Type: `object`
8
+
9
+ ## Fields
10
+
11
+ | Field | Type | Required | Format | Allowed values | Default | Nullable | Description |
12
+ |---|---|---:|---|---|---|---:|---|
13
+ | `flags` | `object` | Yes | | | | No | |
14
+ | `idempotency_key` | `string` | Yes | | | | No | |
15
+
16
+ ## Example
17
+
18
+ None declared in canonical OpenAPI.
@@ -0,0 +1,18 @@
1
+ # FlagOperationError
2
+
3
+ Model ID: `FlagOperationError`
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` | [`UnknownFlagOperation`](./UnknownFlagOperation.md) | No | | | | Yes | |
15
+
16
+ ## Example
17
+
18
+ None declared in canonical OpenAPI.
@@ -0,0 +1,20 @@
1
+ # FlagOperationReceipt
2
+
3
+ Model ID: `FlagOperationReceipt`
4
+
5
+ Original committed patch, even when current flags have since changed.
6
+
7
+ Type: `object`
8
+
9
+ ## Fields
10
+
11
+ | Field | Type | Required | Format | Allowed values | Default | Nullable | Description |
12
+ |---|---|---:|---|---|---|---:|---|
13
+ | `flags` | `object` | Yes | | | | No | |
14
+ | `idempotency_key` | `string` | Yes | | | | No | |
15
+ | `patient_id` | `string` | Yes | | | | No | |
16
+ | `status` | `string` | Yes | | | | No | |
17
+
18
+ ## Example
19
+
20
+ None declared in canonical OpenAPI.
@@ -10,6 +10,7 @@ Type: `object`
10
10
 
11
11
  | Field | Type | Required | Format | Allowed values | Default | Nullable | Description |
12
12
  |---|---|---:|---|---|---|---:|---|
13
+ | `change_pending` | `boolean` | No | | | `false` | No | An explicit insurance change is awaiting reconciliation. |
13
14
  | `copay` | `number|null` | No | | | | Yes | Fixed copay amount, when known. |
14
15
  | `deductible` | `number|null` | No | | | | Yes | Plan deductible amount, when known. |
15
16
  | `effective_date` | `string|null` | No | | | | Yes | Date coverage begins. |
@@ -20,6 +21,7 @@ Type: `object`
20
21
  | `plan_name` | `string|null` | No | | | | Yes | Display name of the specific insurance plan. |
21
22
  | `plan_type` | `string|null` | No | | | | Yes | HMO, PPO, EPO, POS, etc. |
22
23
  | `priority` | [`InsurancePriority`](./InsurancePriority.md) | Yes | | | | No | Coordination-of-benefits order: primary, secondary, or tertiary. |
24
+ | `status` | `string` | No | | active, cancelled, draft, entered-in-error | `"active"` | No | Saved Coverage record status, distinct from eligibility. Cancelled records are retained history. |
23
25
  | `subscriber_date_of_birth` | `string|null` | No | | | | Yes | Subscriber's date of birth, when the patient is not the subscriber. |
24
26
  | `subscriber_first_name` | `string|null` | No | | | | Yes | Subscriber's first name, when the patient is not the subscriber. |
25
27
  | `subscriber_id` | `string|null` | No | | | | Yes | Subscriber's identifier, when different from member_id. |
@@ -0,0 +1,25 @@
1
+ # ReplaceInsuranceRequest
2
+
3
+ Model ID: `ReplaceInsuranceRequest`
4
+
5
+ Explicitly replace an already-saved primary self Coverage.
6
+
7
+ Reuse request_id and the identical body for retries. OCR rescans before
8
+ initial save and eligibility retries must not call this operation.
9
+
10
+ Type: `object`
11
+
12
+ ## Fields
13
+
14
+ | Field | Type | Required | Format | Allowed values | Default | Nullable | Description |
15
+ |---|---|---:|---|---|---|---:|---|
16
+ | `image` | `string` | Yes | | | | No | Reviewed replacement card image, base64 PNG/JPEG. The previous card is not reused. |
17
+ | `member_id` | `string` | Yes | | | | No | |
18
+ | `payer_id` | `string` | Yes | | | | No | |
19
+ | `payer_name` | `string` | Yes | | | | No | |
20
+ | `request_id` | `string` | Yes | uuid | | | No | Client-generated UUID retained for every retry of this confirmed change. |
21
+ | `state` | `string` | Yes | | | | No | Reviewed US coverage state used for vendor package matching. |
22
+
23
+ ## Example
24
+
25
+ None declared in canonical OpenAPI.
@@ -0,0 +1,20 @@
1
+ # ReplaceInsuranceResponse
2
+
3
+ Model ID: `ReplaceInsuranceResponse`
4
+
5
+ No insurance details or raw vendor errors are returned.
6
+
7
+ Type: `object`
8
+
9
+ ## Fields
10
+
11
+ | Field | Type | Required | Format | Allowed values | Default | Nullable | Description |
12
+ |---|---|---:|---|---|---|---:|---|
13
+ | `code` | `string` | Yes | | replacement_completed, replacement_pending | | No | |
14
+ | `coverage_id` | `string|null` | Yes | | | | Yes | New Coverage ID on completion; null while pending. |
15
+ | `previous_coverage_id` | `string` | Yes | | | | No | Retired or pending predecessor Coverage ID. |
16
+ | `status` | `string` | Yes | | completed, pending | | No | |
17
+
18
+ ## Example
19
+
20
+ None declared in canonical OpenAPI.
@@ -0,0 +1,17 @@
1
+ # RetireInsuranceRequest
2
+
3
+ Model ID: `RetireInsuranceRequest`
4
+
5
+ Explicitly retire saved insurance without creating replacement coverage.
6
+
7
+ Type: `object`
8
+
9
+ ## Fields
10
+
11
+ | Field | Type | Required | Format | Allowed values | Default | Nullable | Description |
12
+ |---|---|---:|---|---|---|---:|---|
13
+ | `request_id` | `string` | Yes | uuid | | | No | Client-generated UUID retained for retries of this confirmed removal. |
14
+
15
+ ## Example
16
+
17
+ None declared in canonical OpenAPI.
@@ -0,0 +1,19 @@
1
+ # RetireInsuranceResponse
2
+
3
+ Model ID: `RetireInsuranceResponse`
4
+
5
+ No description.
6
+
7
+ Type: `object`
8
+
9
+ ## Fields
10
+
11
+ | Field | Type | Required | Format | Allowed values | Default | Nullable | Description |
12
+ |---|---|---:|---|---|---|---:|---|
13
+ | `code` | `string` | Yes | | retirement_completed, retirement_pending | | No | |
14
+ | `previous_coverage_id` | `string` | Yes | | | | No | Retired or pending Coverage ID; history is retained. |
15
+ | `status` | `string` | Yes | | completed, pending | | No | |
16
+
17
+ ## Example
18
+
19
+ None declared in canonical OpenAPI.
@@ -0,0 +1,18 @@
1
+ # UnknownFlagOperation
2
+
3
+ Model ID: `UnknownFlagOperation`
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` | Yes | | | | No | |
15
+
16
+ ## Example
17
+
18
+ None declared in canonical OpenAPI.
@@ -33,6 +33,7 @@
33
33
  - [AppleAuthGenerateClientSecretRequest](AppleAuthGenerateClientSecretRequest.md)
34
34
  - [AppleAuthGenerateClientSecretResponse](AppleAuthGenerateClientSecretResponse.md)
35
35
  - [AppleIdTokenClaims](AppleIdTokenClaims.md)
36
+ - [ApplyPatientFlagsRequest](ApplyPatientFlagsRequest.md)
36
37
  - [Appointment](Appointment.md)
37
38
  - [ErrorResponse](appointments.ErrorResponse.md)
38
39
  - [AppointmentStatus](AppointmentStatus.md)
@@ -575,6 +576,8 @@
575
576
  - [FieldAgentVerifyEmailRequest](fieldagent.VerifyEmailRequest.md)
576
577
  - [FieldAgentVerifySmsRequest](fieldagent.VerifySmsRequest.md)
577
578
  - [FieldAgentProfileResponse](FieldAgentProfileResponse.md)
579
+ - [FlagOperationError](FlagOperationError.md)
580
+ - [FlagOperationReceipt](FlagOperationReceipt.md)
578
581
  - [Gender](Gender.md)
579
582
  - [GenderIdentity](GenderIdentity.md)
580
583
  - [GetAgentAgentResponse](GetAgentAgentResponse.md)
@@ -1539,10 +1542,14 @@
1539
1542
  - [RapidTestType](RapidTestType.md)
1540
1543
  - [ReactionSeverity](ReactionSeverity.md)
1541
1544
  - [RecordVitalsResponse](RecordVitalsResponse.md)
1545
+ - [ReplaceInsuranceRequest](ReplaceInsuranceRequest.md)
1546
+ - [ReplaceInsuranceResponse](ReplaceInsuranceResponse.md)
1542
1547
  - [RescheduleAppointmentRequest](RescheduleAppointmentRequest.md)
1543
1548
  - [RespiratoryRate](RespiratoryRate.md)
1544
1549
  - [ResponseAnswer](ResponseAnswer.md)
1545
1550
  - [ResponseItem](ResponseItem.md)
1551
+ - [RetireInsuranceRequest](RetireInsuranceRequest.md)
1552
+ - [RetireInsuranceResponse](RetireInsuranceResponse.md)
1546
1553
  - [rppg.ConnectResponse](rppg.ConnectResponse.md)
1547
1554
  - [SalesforceAccount](SalesforceAccount.md)
1548
1555
  - [SalesforceAccountAssets](SalesforceAccountAssets.md)
@@ -1871,6 +1878,7 @@
1871
1878
  - [UberGetUndeliveredOrdersResponse](UberGetUndeliveredOrdersResponse.md)
1872
1879
  - [UberUpdateDeliveryRequest](UberUpdateDeliveryRequest.md)
1873
1880
  - [UberWaypoint](UberWaypoint.md)
1881
+ - [UnknownFlagOperation](UnknownFlagOperation.md)
1874
1882
  - [UpdateAddressRequest](UpdateAddressRequest.md)
1875
1883
  - [UpdateAddressResponse](UpdateAddressResponse.md)
1876
1884
  - [UpdateAgentRequest](UpdateAgentRequest.md)
@@ -98,6 +98,7 @@ None declared in canonical OpenAPI.
98
98
  "impilo_patient_id": "string",
99
99
  "insurance": [
100
100
  {
101
+ "change_pending": false,
101
102
  "copay": 0,
102
103
  "deductible": 0,
103
104
  "effective_date": "2026-01-01",
@@ -108,6 +109,7 @@ None declared in canonical OpenAPI.
108
109
  "plan_name": "string",
109
110
  "plan_type": "string",
110
111
  "priority": "primary",
112
+ "status": "active",
111
113
  "subscriber_date_of_birth": "2026-01-01",
112
114
  "subscriber_first_name": "string",
113
115
  "subscriber_id": "string",
@@ -0,0 +1,152 @@
1
+ # Apply a keyed patient flag patch
2
+
3
+ Operation ID: `patient.applyPatientFlagsOperation`
4
+
5
+ Commits the exact approved boolean patch and its receipt atomically. Repeating a key returns the original patch without reapplying it. Tenant and patient come only from the verified patient login. On an unknown outcome, look up the original key before proceeding.
6
+
7
+ ## Public method
8
+
9
+ `applyPatientFlagsOperation`
10
+
11
+ Signature: `patient.applyPatientFlagsOperation(request)`
12
+
13
+ Return type: `Promise<FlagOperationReceipt>`
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/flags/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` | [`ApplyPatientFlagsRequest`](../models/ApplyPatientFlagsRequest.md) | Yes | | | | No | |
42
+
43
+ Request model: [`ApplyPatientFlagsRequest`](../models/ApplyPatientFlagsRequest.md)
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` | [`FlagOperationReceipt`](../models/FlagOperationReceipt.md) | application/json | Original committed flag patch, correlated to the operation key |
54
+
55
+ ## Success response examples
56
+
57
+ None declared in canonical OpenAPI.
58
+
59
+ ## Common errors
60
+
61
+ | Status | Shape | Content type | Description |
62
+ |---|---|---|---|
63
+ | `401` | [`FlagOperationError`](../models/FlagOperationError.md) | application/json | Patient login required |
64
+ | `403` | [`FlagOperationError`](../models/FlagOperationError.md) | application/json | Verified tenant required |
65
+ | `404` | [`FlagOperationError`](../models/FlagOperationError.md) | application/json | Patient or receipt not found; a missing receipt does not prove failure |
66
+ | `409` | [`FlagOperationError`](../models/FlagOperationError.md) | application/json | Key reused for different content, or transaction rejected by version contention |
67
+ | `422` | [`FlagOperationError`](../models/FlagOperationError.md) | application/json | Invalid operation key or flag patch |
68
+ | `503` | [`FlagOperationError`](../models/FlagOperationError.md) | application/json | Storage unavailable or outcome unknown; reconcile the original key |
69
+
70
+ ## Error examples
71
+
72
+ ### 401
73
+
74
+ ```json
75
+ {
76
+ "error": "string"
77
+ }
78
+ ```
79
+
80
+ ### 403
81
+
82
+ ```json
83
+ {
84
+ "error": "string"
85
+ }
86
+ ```
87
+
88
+ ### 404
89
+
90
+ ```json
91
+ {
92
+ "error": "string"
93
+ }
94
+ ```
95
+
96
+ ### 409
97
+
98
+ ```json
99
+ {
100
+ "error": "string"
101
+ }
102
+ ```
103
+
104
+ ### 422
105
+
106
+ ```json
107
+ {
108
+ "error": "string"
109
+ }
110
+ ```
111
+
112
+ ### 503
113
+
114
+ ```json
115
+ {
116
+ "error": "string"
117
+ }
118
+ ```
119
+
120
+ ## NodeJS / TypeScript implementation
121
+
122
+ ```ts
123
+ import { HCSDK } from "@healthcloudai/hc-sdk";
124
+ ```
125
+
126
+ ```ts
127
+ const request = "<REQUEST>";
128
+
129
+ const result = await patient.applyPatientFlagsOperation(request);
130
+ ```
131
+
132
+ ## cURL
133
+
134
+ ```bash
135
+ curl -X POST \
136
+ -H 'Authorization: Bearer <ACCESS_TOKEN>' \
137
+ -H 'Content-Type: application/json' \
138
+ -d '<REQUEST_BODY_JSON>' \
139
+ 'https://dev-api-patient.health.cloud/patients/flags/operations'
140
+ ```
141
+
142
+ ## Notes
143
+
144
+ None.
145
+
146
+ ## Prepared Test Console scenario
147
+
148
+ No canonical scenario is currently associated.
149
+
150
+ ## Real response
151
+
152
+ No approved real integration response is currently published. Unapproved candidates are never rendered as examples.