@healthcloudai/hc-sdk 2.13.0 → 2.15.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 +970 -7
- package/dist/index.d.cts +8529 -4251
- package/dist/index.d.ts +8529 -4251
- package/dist/index.js +970 -7
- package/docs/clients/PatientClient.md +2 -0
- package/docs/docs-manifest.json +10 -6
- package/docs/examples/index.md +2 -0
- package/docs/index.md +2 -0
- package/docs/models/Allergy.md +2 -2
- package/docs/models/FamilyHistoryEntry.md +1 -1
- package/docs/models/GetHealthRecordResponse.md +1 -1
- package/docs/models/PatientIntakeRequest.md +26 -0
- package/docs/models/PatientIntakeResponse.md +20 -0
- package/docs/models/{AllergyReaction.md → ehr.AllergyReaction.md} +2 -2
- package/docs/models/{CodedConcept.md → ehr.CodedConcept.md} +1 -1
- package/docs/models/{FamilyCondition.md → ehr.FamilyCondition.md} +2 -1
- package/docs/models/index.md +5 -3
- package/docs/operations/connectors.athenaListMedications.md +1 -0
- package/docs/operations/ehr.listFamilyHistory.md +18 -17
- package/docs/operations/patient.getPatientIntake.md +137 -0
- package/docs/operations/patient.submitPatientIntake.md +703 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -439,6 +439,60 @@ var AuthClient = class extends BaseServiceClient {
|
|
|
439
439
|
}
|
|
440
440
|
};
|
|
441
441
|
|
|
442
|
+
// src/models/openapi-generated/diagnostics/models/RapidTestResult.ts
|
|
443
|
+
function RapidTestResultToJSON(value) {
|
|
444
|
+
return value;
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
// src/models/openapi-generated/diagnostics/models/RapidTestType.ts
|
|
448
|
+
function RapidTestTypeToJSON(value) {
|
|
449
|
+
return value;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
// src/models/openapi-generated/diagnostics/models/SpecimenType.ts
|
|
453
|
+
function SpecimenTypeToJSON(value) {
|
|
454
|
+
return value;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
// src/models/openapi-generated/diagnostics/models/CreateRapidTestRequest.ts
|
|
458
|
+
function CreateRapidTestRequestToJSON(json) {
|
|
459
|
+
return CreateRapidTestRequestToJSONTyped(json, false);
|
|
460
|
+
}
|
|
461
|
+
function CreateRapidTestRequestToJSONTyped(value, ignoreDiscriminator = false) {
|
|
462
|
+
if (value == null) {
|
|
463
|
+
return value;
|
|
464
|
+
}
|
|
465
|
+
return {
|
|
466
|
+
"administered_date": value["administered_date"],
|
|
467
|
+
"device_name": value["device_name"],
|
|
468
|
+
"lot_number": value["lot_number"],
|
|
469
|
+
"notes": value["notes"],
|
|
470
|
+
"performed_date": value["performed_date"] == null ? value["performed_date"] : value["performed_date"].toISOString().substring(0, 10),
|
|
471
|
+
"performed_datetime": value["performed_datetime"] == null ? value["performed_datetime"] : value["performed_datetime"].toISOString(),
|
|
472
|
+
"quantitative_unit": value["quantitative_unit"],
|
|
473
|
+
"quantitative_value": value["quantitative_value"],
|
|
474
|
+
"result": RapidTestResultToJSON(value["result"]),
|
|
475
|
+
"specimen_type": SpecimenTypeToJSON(value["specimen_type"]),
|
|
476
|
+
"type": RapidTestTypeToJSON(value["type"])
|
|
477
|
+
};
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
// src/models/openapi-generated/diagnostics/models/GetScanUploadUrlRequest.ts
|
|
481
|
+
function GetScanUploadUrlRequestToJSON(json) {
|
|
482
|
+
return GetScanUploadUrlRequestToJSONTyped(json, false);
|
|
483
|
+
}
|
|
484
|
+
function GetScanUploadUrlRequestToJSONTyped(value, ignoreDiscriminator = false) {
|
|
485
|
+
if (value == null) {
|
|
486
|
+
return value;
|
|
487
|
+
}
|
|
488
|
+
return {
|
|
489
|
+
"content_type": value["content_type"],
|
|
490
|
+
"filename": value["filename"],
|
|
491
|
+
"gtin": value["gtin"],
|
|
492
|
+
"test_id": value["test_id"]
|
|
493
|
+
};
|
|
494
|
+
}
|
|
495
|
+
|
|
442
496
|
// src/clients/DiagnosticsClient.ts
|
|
443
497
|
var DiagnosticsClient = class extends BaseServiceClient {
|
|
444
498
|
constructor(http) {
|
|
@@ -447,7 +501,7 @@ var DiagnosticsClient = class extends BaseServiceClient {
|
|
|
447
501
|
connect() {
|
|
448
502
|
return this.connectService();
|
|
449
503
|
}
|
|
450
|
-
// ─── Diagnostics
|
|
504
|
+
// ─── Diagnostics ───────────────────────────────────────────────────
|
|
451
505
|
/**
|
|
452
506
|
* List all diagnostics/observations for a patient.
|
|
453
507
|
* GET /patients/{patient_id}/diagnostics
|
|
@@ -457,10 +511,16 @@ var DiagnosticsClient = class extends BaseServiceClient {
|
|
|
457
511
|
pathParams: { patient_id: patientId }
|
|
458
512
|
});
|
|
459
513
|
}
|
|
460
|
-
// ─── GS1 Lookup
|
|
514
|
+
// ─── GS1 Lookup ───────────────────────────────────────────────────
|
|
461
515
|
/**
|
|
462
516
|
* Look up test information by GS1 barcode.
|
|
463
517
|
* GET /patients/{patient_id}/diagnostics/lookup?gs1=...
|
|
518
|
+
*
|
|
519
|
+
* Returns the loose-typed `Gs1LookupResult` (not the OpenAPI-generated
|
|
520
|
+
* `GS1LookupResponse`) because the mock `product` payload returned by the
|
|
521
|
+
* OraQuick lookup is still being normalized — the hand-maintained shape
|
|
522
|
+
* with `product?: Record<string, unknown> | null` tolerates that churn
|
|
523
|
+
* without a contract regenerate on every mock iteration.
|
|
464
524
|
*/
|
|
465
525
|
lookupByGs1(patientId, query) {
|
|
466
526
|
return this.send("GET", "/patients/{patient_id}/diagnostics/lookup", {
|
|
@@ -468,29 +528,31 @@ var DiagnosticsClient = class extends BaseServiceClient {
|
|
|
468
528
|
query
|
|
469
529
|
});
|
|
470
530
|
}
|
|
471
|
-
// ─── Scan Upload URL
|
|
531
|
+
// ─── Scan Upload URL ──────────────────────────────────────────────
|
|
472
532
|
/**
|
|
473
533
|
* Get a presigned S3/Wasabi upload URL for a diagnostic scan.
|
|
474
534
|
* POST /patients/{patient_id}/diagnostics/scan-upload-url
|
|
475
535
|
*/
|
|
476
536
|
getScanUploadUrl(patientId, request) {
|
|
537
|
+
const body = "type" in request && "test_id" in request ? GetScanUploadUrlRequestToJSON(request) : request;
|
|
477
538
|
return this.send("POST", "/patients/{patient_id}/diagnostics/scan-upload-url", {
|
|
478
539
|
pathParams: { patient_id: patientId },
|
|
479
|
-
body
|
|
540
|
+
body
|
|
480
541
|
});
|
|
481
542
|
}
|
|
482
|
-
// ─── Rapid Test
|
|
543
|
+
// ─── Rapid Test ───────────────────────────────────────────────────
|
|
483
544
|
/**
|
|
484
545
|
* Create a rapid test result for a patient.
|
|
485
546
|
* POST /patients/{patient_id}/diagnostics/rapid-tests
|
|
486
547
|
*/
|
|
487
548
|
createRapidTest(patientId, request) {
|
|
549
|
+
const body = "type" in request && "result" in request ? CreateRapidTestRequestToJSON(request) : request;
|
|
488
550
|
return this.send("POST", "/patients/{patient_id}/diagnostics/rapid-tests", {
|
|
489
551
|
pathParams: { patient_id: patientId },
|
|
490
|
-
body
|
|
552
|
+
body
|
|
491
553
|
});
|
|
492
554
|
}
|
|
493
|
-
// ─── Test Result
|
|
555
|
+
// ─── Test Result ──────────────────────────────────────────────────
|
|
494
556
|
/**
|
|
495
557
|
* Get a specific diagnostic test result by ID.
|
|
496
558
|
* GET /patients/{patient_id}/diagnostics/{test_id}
|
|
@@ -500,6 +562,17 @@ var DiagnosticsClient = class extends BaseServiceClient {
|
|
|
500
562
|
pathParams: { patient_id: patientId, test_id: testId }
|
|
501
563
|
});
|
|
502
564
|
}
|
|
565
|
+
// ─── Test Image (captured scan retrieval) ─────────────────────────
|
|
566
|
+
/**
|
|
567
|
+
* Get a short-lived presigned S3 GET URL for the image captured for a
|
|
568
|
+
* diagnostic test result — the retrieval counterpart to `getScanUploadUrl`.
|
|
569
|
+
* GET /patients/{patient_id}/diagnostics/{test_id}/image
|
|
570
|
+
*/
|
|
571
|
+
getTestImage(patientId, testId) {
|
|
572
|
+
return this.send("GET", "/patients/{patient_id}/diagnostics/{test_id}/image", {
|
|
573
|
+
pathParams: { patient_id: patientId, test_id: testId }
|
|
574
|
+
});
|
|
575
|
+
}
|
|
503
576
|
};
|
|
504
577
|
|
|
505
578
|
// src/clients/EhrClient.ts
|
|
@@ -1045,8 +1118,898 @@ function CreateEncounterRequestToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
1045
1118
|
};
|
|
1046
1119
|
}
|
|
1047
1120
|
|
|
1121
|
+
// src/models/openapi-generated/patient/models/ProcedureStatus.ts
|
|
1122
|
+
function ProcedureStatusToJSON(value) {
|
|
1123
|
+
return value;
|
|
1124
|
+
}
|
|
1125
|
+
|
|
1126
|
+
// src/models/openapi-generated/patient/models/ProcedureLaterality.ts
|
|
1127
|
+
function ProcedureLateralityToJSON(value) {
|
|
1128
|
+
return value;
|
|
1129
|
+
}
|
|
1130
|
+
|
|
1131
|
+
// src/models/openapi-generated/patient/models/IntakeSurgery.ts
|
|
1132
|
+
function IntakeSurgeryToJSON(json) {
|
|
1133
|
+
return IntakeSurgeryToJSONTyped(json, false);
|
|
1134
|
+
}
|
|
1135
|
+
function IntakeSurgeryToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1136
|
+
if (value == null) {
|
|
1137
|
+
return value;
|
|
1138
|
+
}
|
|
1139
|
+
return {
|
|
1140
|
+
"anesthesia_type": value["anesthesia_type"],
|
|
1141
|
+
"body_sites": value["body_sites"],
|
|
1142
|
+
"complications": value["complications"],
|
|
1143
|
+
"cpt_code": value["cpt_code"],
|
|
1144
|
+
"description": value["description"],
|
|
1145
|
+
"facility": value["facility"],
|
|
1146
|
+
"indication": value["indication"],
|
|
1147
|
+
"laterality": ProcedureLateralityToJSON(value["laterality"]),
|
|
1148
|
+
"notes": value["notes"],
|
|
1149
|
+
"outcome": value["outcome"],
|
|
1150
|
+
"performed_date": value["performed_date"] == null ? value["performed_date"] : value["performed_date"].toISOString().substring(0, 10),
|
|
1151
|
+
"performed_date_end": value["performed_date_end"] == null ? value["performed_date_end"] : value["performed_date_end"].toISOString().substring(0, 10),
|
|
1152
|
+
"performer_name": value["performer_name"],
|
|
1153
|
+
"snomed_code": value["snomed_code"],
|
|
1154
|
+
"status": ProcedureStatusToJSON(value["status"])
|
|
1155
|
+
};
|
|
1156
|
+
}
|
|
1157
|
+
|
|
1158
|
+
// src/models/openapi-generated/patient/models/FamilyRelationship.ts
|
|
1159
|
+
function FamilyRelationshipToJSON(value) {
|
|
1160
|
+
return value;
|
|
1161
|
+
}
|
|
1162
|
+
|
|
1163
|
+
// src/models/openapi-generated/patient/models/FamilyHistoryStatus.ts
|
|
1164
|
+
function FamilyHistoryStatusToJSON(value) {
|
|
1165
|
+
return value;
|
|
1166
|
+
}
|
|
1167
|
+
|
|
1168
|
+
// src/models/openapi-generated/patient/models/FamilyCondition.ts
|
|
1169
|
+
function FamilyConditionToJSON(json) {
|
|
1170
|
+
return FamilyConditionToJSONTyped(json, false);
|
|
1171
|
+
}
|
|
1172
|
+
function FamilyConditionToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1173
|
+
if (value == null) {
|
|
1174
|
+
return value;
|
|
1175
|
+
}
|
|
1176
|
+
return {
|
|
1177
|
+
"age_at_death": value["age_at_death"],
|
|
1178
|
+
"age_at_onset": value["age_at_onset"],
|
|
1179
|
+
"condition": value["condition"],
|
|
1180
|
+
"icd10_code": value["icd10_code"],
|
|
1181
|
+
"notes": value["notes"],
|
|
1182
|
+
"snomed_code": value["snomed_code"]
|
|
1183
|
+
};
|
|
1184
|
+
}
|
|
1185
|
+
|
|
1186
|
+
// src/models/openapi-generated/patient/models/IntakeFamilyHistory.ts
|
|
1187
|
+
function IntakeFamilyHistoryToJSON(json) {
|
|
1188
|
+
return IntakeFamilyHistoryToJSONTyped(json, false);
|
|
1189
|
+
}
|
|
1190
|
+
function IntakeFamilyHistoryToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1191
|
+
if (value == null) {
|
|
1192
|
+
return value;
|
|
1193
|
+
}
|
|
1194
|
+
return {
|
|
1195
|
+
"age_at_death": value["age_at_death"],
|
|
1196
|
+
"biological": value["biological"],
|
|
1197
|
+
"born_date": value["born_date"] == null ? value["born_date"] : value["born_date"].toISOString().substring(0, 10),
|
|
1198
|
+
"cause_of_death": value["cause_of_death"],
|
|
1199
|
+
"conditions": value["conditions"] == null ? void 0 : value["conditions"].map(FamilyConditionToJSON),
|
|
1200
|
+
"deceased": value["deceased"],
|
|
1201
|
+
"member_name": value["member_name"],
|
|
1202
|
+
"notes": value["notes"],
|
|
1203
|
+
"recorded_date": value["recorded_date"] == null ? value["recorded_date"] : value["recorded_date"].toISOString().substring(0, 10),
|
|
1204
|
+
"relationship": FamilyRelationshipToJSON(value["relationship"]),
|
|
1205
|
+
"sex": value["sex"],
|
|
1206
|
+
"status": FamilyHistoryStatusToJSON(value["status"])
|
|
1207
|
+
};
|
|
1208
|
+
}
|
|
1209
|
+
|
|
1210
|
+
// src/models/openapi-generated/patient/models/PerinatalHistory.ts
|
|
1211
|
+
function PerinatalHistoryToJSON(json) {
|
|
1212
|
+
return PerinatalHistoryToJSONTyped(json, false);
|
|
1213
|
+
}
|
|
1214
|
+
function PerinatalHistoryToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1215
|
+
if (value == null) {
|
|
1216
|
+
return value;
|
|
1217
|
+
}
|
|
1218
|
+
return {
|
|
1219
|
+
"delivery_date": value["delivery_date"] == null ? value["delivery_date"] : value["delivery_date"].toISOString().substring(0, 10),
|
|
1220
|
+
"delivery_method": value["delivery_method"],
|
|
1221
|
+
"gestational_age_weeks": value["gestational_age_weeks"],
|
|
1222
|
+
"maternal_complications": value["maternal_complications"],
|
|
1223
|
+
"neonatal_complications": value["neonatal_complications"],
|
|
1224
|
+
"notes": value["notes"],
|
|
1225
|
+
"outcome": value["outcome"],
|
|
1226
|
+
"pregnancy_year": value["pregnancy_year"]
|
|
1227
|
+
};
|
|
1228
|
+
}
|
|
1229
|
+
|
|
1230
|
+
// src/models/openapi-generated/patient/models/GynHistory.ts
|
|
1231
|
+
function GynHistoryToJSON(json) {
|
|
1232
|
+
return GynHistoryToJSONTyped(json, false);
|
|
1233
|
+
}
|
|
1234
|
+
function GynHistoryToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1235
|
+
if (value == null) {
|
|
1236
|
+
return value;
|
|
1237
|
+
}
|
|
1238
|
+
return {
|
|
1239
|
+
"cervical_screening_history": value["cervical_screening_history"],
|
|
1240
|
+
"contraception": value["contraception"],
|
|
1241
|
+
"last_menstrual_period": value["last_menstrual_period"] == null ? value["last_menstrual_period"] : value["last_menstrual_period"].toISOString().substring(0, 10),
|
|
1242
|
+
"menarche_age": value["menarche_age"],
|
|
1243
|
+
"menopause_age": value["menopause_age"],
|
|
1244
|
+
"menstrual_history": value["menstrual_history"],
|
|
1245
|
+
"notes": value["notes"],
|
|
1246
|
+
"pregnancy_history": value["pregnancy_history"]
|
|
1247
|
+
};
|
|
1248
|
+
}
|
|
1249
|
+
|
|
1250
|
+
// src/models/openapi-generated/patient/models/SubstanceStatus.ts
|
|
1251
|
+
function SubstanceStatusToJSON(value) {
|
|
1252
|
+
return value;
|
|
1253
|
+
}
|
|
1254
|
+
|
|
1255
|
+
// src/models/openapi-generated/patient/models/SubstanceUse.ts
|
|
1256
|
+
function SubstanceUseToJSON(json) {
|
|
1257
|
+
return SubstanceUseToJSONTyped(json, false);
|
|
1258
|
+
}
|
|
1259
|
+
function SubstanceUseToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1260
|
+
if (value == null) {
|
|
1261
|
+
return value;
|
|
1262
|
+
}
|
|
1263
|
+
return {
|
|
1264
|
+
"frequency": value["frequency"],
|
|
1265
|
+
"notes": value["notes"],
|
|
1266
|
+
"quit_year": value["quit_year"],
|
|
1267
|
+
"route": value["route"],
|
|
1268
|
+
"start_year": value["start_year"],
|
|
1269
|
+
"status": SubstanceStatusToJSON(value["status"]),
|
|
1270
|
+
"substance": value["substance"]
|
|
1271
|
+
};
|
|
1272
|
+
}
|
|
1273
|
+
|
|
1274
|
+
// src/models/openapi-generated/patient/models/DietCategory.ts
|
|
1275
|
+
function DietCategoryToJSON(value) {
|
|
1276
|
+
return value;
|
|
1277
|
+
}
|
|
1278
|
+
|
|
1279
|
+
// src/models/openapi-generated/patient/models/ExerciseFrequency.ts
|
|
1280
|
+
function ExerciseFrequencyToJSON(value) {
|
|
1281
|
+
return value;
|
|
1282
|
+
}
|
|
1283
|
+
|
|
1284
|
+
// src/models/openapi-generated/patient/models/LivingSituation.ts
|
|
1285
|
+
function LivingSituationToJSON(value) {
|
|
1286
|
+
return value;
|
|
1287
|
+
}
|
|
1288
|
+
|
|
1289
|
+
// src/models/openapi-generated/patient/models/SmokingStatus.ts
|
|
1290
|
+
function SmokingStatusToJSON(value) {
|
|
1291
|
+
return value;
|
|
1292
|
+
}
|
|
1293
|
+
|
|
1294
|
+
// src/models/openapi-generated/patient/models/TobaccoUse.ts
|
|
1295
|
+
function TobaccoUseToJSON(json) {
|
|
1296
|
+
return TobaccoUseToJSONTyped(json, false);
|
|
1297
|
+
}
|
|
1298
|
+
function TobaccoUseToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1299
|
+
if (value == null) {
|
|
1300
|
+
return value;
|
|
1301
|
+
}
|
|
1302
|
+
return {
|
|
1303
|
+
"cessation_aids": value["cessation_aids"],
|
|
1304
|
+
"cigarettes_per_day": value["cigarettes_per_day"],
|
|
1305
|
+
"pack_years": value["pack_years"],
|
|
1306
|
+
"quit_year": value["quit_year"],
|
|
1307
|
+
"start_year": value["start_year"],
|
|
1308
|
+
"status": SmokingStatusToJSON(value["status"])
|
|
1309
|
+
};
|
|
1310
|
+
}
|
|
1311
|
+
|
|
1312
|
+
// src/models/openapi-generated/patient/models/AlcoholFrequency.ts
|
|
1313
|
+
function AlcoholFrequencyToJSON(value) {
|
|
1314
|
+
return value;
|
|
1315
|
+
}
|
|
1316
|
+
|
|
1317
|
+
// src/models/openapi-generated/patient/models/AlcoholUse.ts
|
|
1318
|
+
function AlcoholUseToJSON(json) {
|
|
1319
|
+
return AlcoholUseToJSONTyped(json, false);
|
|
1320
|
+
}
|
|
1321
|
+
function AlcoholUseToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1322
|
+
if (value == null) {
|
|
1323
|
+
return value;
|
|
1324
|
+
}
|
|
1325
|
+
return {
|
|
1326
|
+
"binge_drinking": value["binge_drinking"],
|
|
1327
|
+
"drinks_per_week": value["drinks_per_week"],
|
|
1328
|
+
"frequency": AlcoholFrequencyToJSON(value["frequency"]),
|
|
1329
|
+
"notes": value["notes"]
|
|
1330
|
+
};
|
|
1331
|
+
}
|
|
1332
|
+
|
|
1333
|
+
// src/models/openapi-generated/patient/models/GenderIdentity.ts
|
|
1334
|
+
function GenderIdentityToJSON(value) {
|
|
1335
|
+
return value;
|
|
1336
|
+
}
|
|
1337
|
+
|
|
1338
|
+
// src/models/openapi-generated/patient/models/EducationLevel.ts
|
|
1339
|
+
function EducationLevelToJSON(value) {
|
|
1340
|
+
return value;
|
|
1341
|
+
}
|
|
1342
|
+
|
|
1343
|
+
// src/models/openapi-generated/patient/models/SexualOrientation.ts
|
|
1344
|
+
function SexualOrientationToJSON(value) {
|
|
1345
|
+
return value;
|
|
1346
|
+
}
|
|
1347
|
+
|
|
1348
|
+
// src/models/openapi-generated/patient/models/IntakeSocialHistory.ts
|
|
1349
|
+
function IntakeSocialHistoryToJSON(json) {
|
|
1350
|
+
return IntakeSocialHistoryToJSONTyped(json, false);
|
|
1351
|
+
}
|
|
1352
|
+
function IntakeSocialHistoryToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1353
|
+
if (value == null) {
|
|
1354
|
+
return value;
|
|
1355
|
+
}
|
|
1356
|
+
return {
|
|
1357
|
+
"alcohol": AlcoholUseToJSON(value["alcohol"]),
|
|
1358
|
+
"contraception": value["contraception"],
|
|
1359
|
+
"diet_category": DietCategoryToJSON(value["diet_category"]),
|
|
1360
|
+
"diet_description": value["diet_description"],
|
|
1361
|
+
"education": EducationLevelToJSON(value["education"]),
|
|
1362
|
+
"employer": value["employer"],
|
|
1363
|
+
"exercise_frequency": ExerciseFrequencyToJSON(value["exercise_frequency"]),
|
|
1364
|
+
"exercise_minutes_per_week": value["exercise_minutes_per_week"],
|
|
1365
|
+
"gender_identity": GenderIdentityToJSON(value["gender_identity"]),
|
|
1366
|
+
"living_situation": LivingSituationToJSON(value["living_situation"]),
|
|
1367
|
+
"notes": value["notes"],
|
|
1368
|
+
"number_of_dependents": value["number_of_dependents"],
|
|
1369
|
+
"occupation": value["occupation"],
|
|
1370
|
+
"occupational_exposures": value["occupational_exposures"],
|
|
1371
|
+
"sexual_orientation": SexualOrientationToJSON(value["sexual_orientation"]),
|
|
1372
|
+
"sexually_active": value["sexually_active"],
|
|
1373
|
+
"substances": value["substances"] == null ? void 0 : value["substances"].map(SubstanceUseToJSON),
|
|
1374
|
+
"tobacco": TobaccoUseToJSON(value["tobacco"]),
|
|
1375
|
+
"travel_history": value["travel_history"]
|
|
1376
|
+
};
|
|
1377
|
+
}
|
|
1378
|
+
|
|
1379
|
+
// src/models/openapi-generated/patient/models/CancerTreatmentStatus.ts
|
|
1380
|
+
function CancerTreatmentStatusToJSON(value) {
|
|
1381
|
+
return value;
|
|
1382
|
+
}
|
|
1383
|
+
|
|
1384
|
+
// src/models/openapi-generated/patient/models/TreatmentModality.ts
|
|
1385
|
+
function TreatmentModalityToJSON(value) {
|
|
1386
|
+
return value;
|
|
1387
|
+
}
|
|
1388
|
+
|
|
1389
|
+
// src/models/openapi-generated/patient/models/IntakeCancerTreatment.ts
|
|
1390
|
+
function IntakeCancerTreatmentToJSON(json) {
|
|
1391
|
+
return IntakeCancerTreatmentToJSONTyped(json, false);
|
|
1392
|
+
}
|
|
1393
|
+
function IntakeCancerTreatmentToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1394
|
+
if (value == null) {
|
|
1395
|
+
return value;
|
|
1396
|
+
}
|
|
1397
|
+
return {
|
|
1398
|
+
"description": value["description"],
|
|
1399
|
+
"end_date": value["end_date"] == null ? value["end_date"] : value["end_date"].toISOString().substring(0, 10),
|
|
1400
|
+
"facility": value["facility"],
|
|
1401
|
+
"modality": TreatmentModalityToJSON(value["modality"]),
|
|
1402
|
+
"notes": value["notes"],
|
|
1403
|
+
"provider_name": value["provider_name"],
|
|
1404
|
+
"response": value["response"],
|
|
1405
|
+
"start_date": value["start_date"] == null ? value["start_date"] : value["start_date"].toISOString().substring(0, 10),
|
|
1406
|
+
"status": CancerTreatmentStatusToJSON(value["status"])
|
|
1407
|
+
};
|
|
1408
|
+
}
|
|
1409
|
+
|
|
1410
|
+
// src/models/openapi-generated/patient/models/TNMStaging.ts
|
|
1411
|
+
function TNMStagingToJSON(json) {
|
|
1412
|
+
return TNMStagingToJSONTyped(json, false);
|
|
1413
|
+
}
|
|
1414
|
+
function TNMStagingToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1415
|
+
if (value == null) {
|
|
1416
|
+
return value;
|
|
1417
|
+
}
|
|
1418
|
+
return {
|
|
1419
|
+
"clinical": value["clinical"],
|
|
1420
|
+
"edition": value["edition"],
|
|
1421
|
+
"m": value["m"],
|
|
1422
|
+
"n": value["n"],
|
|
1423
|
+
"t": value["t"]
|
|
1424
|
+
};
|
|
1425
|
+
}
|
|
1426
|
+
|
|
1427
|
+
// src/models/openapi-generated/patient/models/CancerLaterality.ts
|
|
1428
|
+
function CancerLateralityToJSON(value) {
|
|
1429
|
+
return value;
|
|
1430
|
+
}
|
|
1431
|
+
|
|
1432
|
+
// src/models/openapi-generated/patient/models/CancerStage.ts
|
|
1433
|
+
function CancerStageToJSON(value) {
|
|
1434
|
+
return value;
|
|
1435
|
+
}
|
|
1436
|
+
|
|
1437
|
+
// src/models/openapi-generated/patient/models/IntakeCancerCase.ts
|
|
1438
|
+
function IntakeCancerCaseToJSON(json) {
|
|
1439
|
+
return IntakeCancerCaseToJSONTyped(json, false);
|
|
1440
|
+
}
|
|
1441
|
+
function IntakeCancerCaseToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1442
|
+
if (value == null) {
|
|
1443
|
+
return value;
|
|
1444
|
+
}
|
|
1445
|
+
return {
|
|
1446
|
+
"biomarkers": value["biomarkers"],
|
|
1447
|
+
"cancer_type": value["cancer_type"],
|
|
1448
|
+
"diagnosis_date": value["diagnosis_date"] == null ? value["diagnosis_date"] : value["diagnosis_date"].toISOString().substring(0, 10),
|
|
1449
|
+
"diagnosis_method": value["diagnosis_method"],
|
|
1450
|
+
"grade": value["grade"],
|
|
1451
|
+
"histology": value["histology"],
|
|
1452
|
+
"histology_code": value["histology_code"],
|
|
1453
|
+
"icd10_code": value["icd10_code"],
|
|
1454
|
+
"laterality": CancerLateralityToJSON(value["laterality"]),
|
|
1455
|
+
"metastatic_sites": value["metastatic_sites"],
|
|
1456
|
+
"notes": value["notes"],
|
|
1457
|
+
"primary_site": value["primary_site"],
|
|
1458
|
+
"recurrence_date": value["recurrence_date"] == null ? value["recurrence_date"] : value["recurrence_date"].toISOString().substring(0, 10),
|
|
1459
|
+
"remission_date": value["remission_date"] == null ? value["remission_date"] : value["remission_date"].toISOString().substring(0, 10),
|
|
1460
|
+
"snomed_code": value["snomed_code"],
|
|
1461
|
+
"stage": CancerStageToJSON(value["stage"]),
|
|
1462
|
+
"subsite": value["subsite"],
|
|
1463
|
+
"tnm": TNMStagingToJSON(value["tnm"]),
|
|
1464
|
+
"treatments": value["treatments"] == null ? void 0 : value["treatments"].map(IntakeCancerTreatmentToJSON)
|
|
1465
|
+
};
|
|
1466
|
+
}
|
|
1467
|
+
|
|
1468
|
+
// src/models/openapi-generated/patient/models/IntakeMedication.ts
|
|
1469
|
+
function IntakeMedicationToJSON(json) {
|
|
1470
|
+
return IntakeMedicationToJSONTyped(json, false);
|
|
1471
|
+
}
|
|
1472
|
+
function IntakeMedicationToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1473
|
+
if (value == null) {
|
|
1474
|
+
return value;
|
|
1475
|
+
}
|
|
1476
|
+
return {
|
|
1477
|
+
"authored_on": value["authored_on"] == null ? value["authored_on"] : value["authored_on"].toISOString().substring(0, 10),
|
|
1478
|
+
"brand_name": value["brand_name"],
|
|
1479
|
+
"discontinued_reason": value["discontinued_reason"],
|
|
1480
|
+
"dosage": DosageToJSON(value["dosage"]),
|
|
1481
|
+
"end_date": value["end_date"] == null ? value["end_date"] : value["end_date"].toISOString().substring(0, 10),
|
|
1482
|
+
"generic_name": value["generic_name"],
|
|
1483
|
+
"indication": value["indication"],
|
|
1484
|
+
"name": value["name"],
|
|
1485
|
+
"ndc_code": value["ndc_code"],
|
|
1486
|
+
"notes": value["notes"],
|
|
1487
|
+
"pharmacy": value["pharmacy"],
|
|
1488
|
+
"prescriber_name": value["prescriber_name"],
|
|
1489
|
+
"refills_authorized": value["refills_authorized"],
|
|
1490
|
+
"refills_remaining": value["refills_remaining"],
|
|
1491
|
+
"route": MedicationRouteToJSON(value["route"]),
|
|
1492
|
+
"rxnorm_code": value["rxnorm_code"],
|
|
1493
|
+
"start_date": value["start_date"] == null ? value["start_date"] : value["start_date"].toISOString().substring(0, 10),
|
|
1494
|
+
"status": MedicationStatusToJSON(value["status"])
|
|
1495
|
+
};
|
|
1496
|
+
}
|
|
1497
|
+
|
|
1498
|
+
// src/models/openapi-generated/patient/models/AllergyStatus.ts
|
|
1499
|
+
function AllergyStatusToJSON(value) {
|
|
1500
|
+
return value;
|
|
1501
|
+
}
|
|
1502
|
+
|
|
1503
|
+
// src/models/openapi-generated/patient/models/AllergyCategory.ts
|
|
1504
|
+
function AllergyCategoryToJSON(value) {
|
|
1505
|
+
return value;
|
|
1506
|
+
}
|
|
1507
|
+
|
|
1508
|
+
// src/models/openapi-generated/patient/models/CodedConcept.ts
|
|
1509
|
+
function CodedConceptToJSON(json) {
|
|
1510
|
+
return CodedConceptToJSONTyped(json, false);
|
|
1511
|
+
}
|
|
1512
|
+
function CodedConceptToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1513
|
+
if (value == null) {
|
|
1514
|
+
return value;
|
|
1515
|
+
}
|
|
1516
|
+
return {
|
|
1517
|
+
"code": value["code"],
|
|
1518
|
+
"display": value["display"],
|
|
1519
|
+
"system": value["system"]
|
|
1520
|
+
};
|
|
1521
|
+
}
|
|
1522
|
+
|
|
1523
|
+
// src/models/openapi-generated/patient/models/IntoleranceType.ts
|
|
1524
|
+
function IntoleranceTypeToJSON(value) {
|
|
1525
|
+
return value;
|
|
1526
|
+
}
|
|
1527
|
+
|
|
1528
|
+
// src/models/openapi-generated/patient/models/ReactionSeverity.ts
|
|
1529
|
+
function ReactionSeverityToJSON(value) {
|
|
1530
|
+
return value;
|
|
1531
|
+
}
|
|
1532
|
+
|
|
1533
|
+
// src/models/openapi-generated/patient/models/AllergyReaction.ts
|
|
1534
|
+
function AllergyReactionToJSON(json) {
|
|
1535
|
+
return AllergyReactionToJSONTyped(json, false);
|
|
1536
|
+
}
|
|
1537
|
+
function AllergyReactionToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1538
|
+
if (value == null) {
|
|
1539
|
+
return value;
|
|
1540
|
+
}
|
|
1541
|
+
return {
|
|
1542
|
+
"manifestation": value["manifestation"],
|
|
1543
|
+
"manifestation_code": CodedConceptToJSON(value["manifestation_code"]),
|
|
1544
|
+
"notes": value["notes"],
|
|
1545
|
+
"onset": value["onset"] == null ? value["onset"] : value["onset"].toISOString().substring(0, 10),
|
|
1546
|
+
"severity": ReactionSeverityToJSON(value["severity"])
|
|
1547
|
+
};
|
|
1548
|
+
}
|
|
1549
|
+
|
|
1550
|
+
// src/models/openapi-generated/patient/models/AllergyCriticality.ts
|
|
1551
|
+
function AllergyCriticalityToJSON(value) {
|
|
1552
|
+
return value;
|
|
1553
|
+
}
|
|
1554
|
+
|
|
1555
|
+
// src/models/openapi-generated/patient/models/IntakeAllergy.ts
|
|
1556
|
+
function IntakeAllergyToJSON(json) {
|
|
1557
|
+
return IntakeAllergyToJSONTyped(json, false);
|
|
1558
|
+
}
|
|
1559
|
+
function IntakeAllergyToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1560
|
+
if (value == null) {
|
|
1561
|
+
return value;
|
|
1562
|
+
}
|
|
1563
|
+
return {
|
|
1564
|
+
"allergen": value["allergen"],
|
|
1565
|
+
"allergen_code": CodedConceptToJSON(value["allergen_code"]),
|
|
1566
|
+
"asserted_date": value["asserted_date"] == null ? value["asserted_date"] : value["asserted_date"].toISOString().substring(0, 10),
|
|
1567
|
+
"category": AllergyCategoryToJSON(value["category"]),
|
|
1568
|
+
"criticality": AllergyCriticalityToJSON(value["criticality"]),
|
|
1569
|
+
"intolerance_type": IntoleranceTypeToJSON(value["intolerance_type"]),
|
|
1570
|
+
"notes": value["notes"],
|
|
1571
|
+
"onset_date": value["onset_date"] == null ? value["onset_date"] : value["onset_date"].toISOString().substring(0, 10),
|
|
1572
|
+
"reactions": value["reactions"] == null ? void 0 : value["reactions"].map(AllergyReactionToJSON),
|
|
1573
|
+
"resolved_date": value["resolved_date"] == null ? value["resolved_date"] : value["resolved_date"].toISOString().substring(0, 10),
|
|
1574
|
+
"status": AllergyStatusToJSON(value["status"])
|
|
1575
|
+
};
|
|
1576
|
+
}
|
|
1577
|
+
|
|
1578
|
+
// src/models/openapi-generated/patient/models/ProblemCategory.ts
|
|
1579
|
+
function ProblemCategoryToJSON(value) {
|
|
1580
|
+
return value;
|
|
1581
|
+
}
|
|
1582
|
+
|
|
1583
|
+
// src/models/openapi-generated/patient/models/ProblemSeverity.ts
|
|
1584
|
+
function ProblemSeverityToJSON(value) {
|
|
1585
|
+
return value;
|
|
1586
|
+
}
|
|
1587
|
+
|
|
1588
|
+
// src/models/openapi-generated/patient/models/ProblemClinicalStatus.ts
|
|
1589
|
+
function ProblemClinicalStatusToJSON(value) {
|
|
1590
|
+
return value;
|
|
1591
|
+
}
|
|
1592
|
+
|
|
1593
|
+
// src/models/openapi-generated/patient/models/IntakeProblem.ts
|
|
1594
|
+
function IntakeProblemToJSON(json) {
|
|
1595
|
+
return IntakeProblemToJSONTyped(json, false);
|
|
1596
|
+
}
|
|
1597
|
+
function IntakeProblemToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1598
|
+
if (value == null) {
|
|
1599
|
+
return value;
|
|
1600
|
+
}
|
|
1601
|
+
return {
|
|
1602
|
+
"asserted_date": value["asserted_date"] == null ? value["asserted_date"] : value["asserted_date"].toISOString().substring(0, 10),
|
|
1603
|
+
"body_site": value["body_site"],
|
|
1604
|
+
"categories": value["categories"] == null ? void 0 : value["categories"].map(ProblemCategoryToJSON),
|
|
1605
|
+
"clinical_status": ProblemClinicalStatusToJSON(value["clinical_status"]),
|
|
1606
|
+
"description": value["description"],
|
|
1607
|
+
"icd10_code": value["icd10_code"],
|
|
1608
|
+
"laterality": value["laterality"],
|
|
1609
|
+
"notes": value["notes"],
|
|
1610
|
+
"onset_age": value["onset_age"],
|
|
1611
|
+
"onset_date": value["onset_date"] == null ? value["onset_date"] : value["onset_date"].toISOString().substring(0, 10),
|
|
1612
|
+
"recorded_date": value["recorded_date"] == null ? value["recorded_date"] : value["recorded_date"].toISOString(),
|
|
1613
|
+
"resolved_date": value["resolved_date"] == null ? value["resolved_date"] : value["resolved_date"].toISOString().substring(0, 10),
|
|
1614
|
+
"severity": ProblemSeverityToJSON(value["severity"]),
|
|
1615
|
+
"snomed_code": value["snomed_code"]
|
|
1616
|
+
};
|
|
1617
|
+
}
|
|
1618
|
+
|
|
1619
|
+
// src/models/openapi-generated/patient/models/VaccinationSite.ts
|
|
1620
|
+
function VaccinationSiteToJSON(value) {
|
|
1621
|
+
return value;
|
|
1622
|
+
}
|
|
1623
|
+
|
|
1624
|
+
// src/models/openapi-generated/patient/models/ImmunizationStatus.ts
|
|
1625
|
+
function ImmunizationStatusToJSON(value) {
|
|
1626
|
+
return value;
|
|
1627
|
+
}
|
|
1628
|
+
|
|
1629
|
+
// src/models/openapi-generated/patient/models/ImmunizationRoute.ts
|
|
1630
|
+
function ImmunizationRouteToJSON(value) {
|
|
1631
|
+
return value;
|
|
1632
|
+
}
|
|
1633
|
+
|
|
1634
|
+
// src/models/openapi-generated/patient/models/ImmunizationReaction.ts
|
|
1635
|
+
function ImmunizationReactionToJSON(json) {
|
|
1636
|
+
return ImmunizationReactionToJSONTyped(json, false);
|
|
1637
|
+
}
|
|
1638
|
+
function ImmunizationReactionToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1639
|
+
if (value == null) {
|
|
1640
|
+
return value;
|
|
1641
|
+
}
|
|
1642
|
+
return {
|
|
1643
|
+
"notes": value["notes"],
|
|
1644
|
+
"onset_date": value["onset_date"] == null ? value["onset_date"] : value["onset_date"].toISOString().substring(0, 10),
|
|
1645
|
+
"reaction": value["reaction"],
|
|
1646
|
+
"severity": ReactionSeverityToJSON(value["severity"])
|
|
1647
|
+
};
|
|
1648
|
+
}
|
|
1649
|
+
|
|
1650
|
+
// src/models/openapi-generated/patient/models/IntakeVaccine.ts
|
|
1651
|
+
function IntakeVaccineToJSON(json) {
|
|
1652
|
+
return IntakeVaccineToJSONTyped(json, false);
|
|
1653
|
+
}
|
|
1654
|
+
function IntakeVaccineToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1655
|
+
if (value == null) {
|
|
1656
|
+
return value;
|
|
1657
|
+
}
|
|
1658
|
+
return {
|
|
1659
|
+
"administered_by": value["administered_by"],
|
|
1660
|
+
"administered_date": value["administered_date"] == null ? value["administered_date"] : value["administered_date"].toISOString().substring(0, 10),
|
|
1661
|
+
"administered_datetime": value["administered_datetime"] == null ? value["administered_datetime"] : value["administered_datetime"].toISOString(),
|
|
1662
|
+
"cvx_code": value["cvx_code"],
|
|
1663
|
+
"dose_number": value["dose_number"],
|
|
1664
|
+
"dose_quantity": value["dose_quantity"],
|
|
1665
|
+
"dose_unit": value["dose_unit"],
|
|
1666
|
+
"expiration_date": value["expiration_date"] == null ? value["expiration_date"] : value["expiration_date"].toISOString().substring(0, 10),
|
|
1667
|
+
"lot_number": value["lot_number"],
|
|
1668
|
+
"manufacturer": value["manufacturer"],
|
|
1669
|
+
"mvx_code": value["mvx_code"],
|
|
1670
|
+
"not_done_reason": value["not_done_reason"],
|
|
1671
|
+
"notes": value["notes"],
|
|
1672
|
+
"reactions": value["reactions"] == null ? void 0 : value["reactions"].map(ImmunizationReactionToJSON),
|
|
1673
|
+
"reason_codes": value["reason_codes"],
|
|
1674
|
+
"route": ImmunizationRouteToJSON(value["route"]),
|
|
1675
|
+
"series_doses": value["series_doses"],
|
|
1676
|
+
"series_name": value["series_name"],
|
|
1677
|
+
"site": VaccinationSiteToJSON(value["site"]),
|
|
1678
|
+
"status": ImmunizationStatusToJSON(value["status"]),
|
|
1679
|
+
"vaccine_name": value["vaccine_name"],
|
|
1680
|
+
"vis_document_date": value["vis_document_date"] == null ? value["vis_document_date"] : value["vis_document_date"].toISOString().substring(0, 10)
|
|
1681
|
+
};
|
|
1682
|
+
}
|
|
1683
|
+
|
|
1684
|
+
// src/models/openapi-generated/patient/models/PatientIntakeRequest.ts
|
|
1685
|
+
function PatientIntakeRequestToJSON(json) {
|
|
1686
|
+
return PatientIntakeRequestToJSONTyped(json, false);
|
|
1687
|
+
}
|
|
1688
|
+
function PatientIntakeRequestToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1689
|
+
if (value == null) {
|
|
1690
|
+
return value;
|
|
1691
|
+
}
|
|
1692
|
+
return {
|
|
1693
|
+
"allergies": value["allergies"] == null ? void 0 : value["allergies"].map(IntakeAllergyToJSON),
|
|
1694
|
+
"cancer_cases": value["cancer_cases"] == null ? void 0 : value["cancer_cases"].map(IntakeCancerCaseToJSON),
|
|
1695
|
+
"family_history": value["family_history"] == null ? void 0 : value["family_history"].map(IntakeFamilyHistoryToJSON),
|
|
1696
|
+
"gyn_history": value["gyn_history"] == null ? void 0 : value["gyn_history"].map(GynHistoryToJSON),
|
|
1697
|
+
"medications": value["medications"] == null ? void 0 : value["medications"].map(IntakeMedicationToJSON),
|
|
1698
|
+
"perinatal_history": value["perinatal_history"] == null ? void 0 : value["perinatal_history"].map(PerinatalHistoryToJSON),
|
|
1699
|
+
"problems": value["problems"] == null ? void 0 : value["problems"].map(IntakeProblemToJSON),
|
|
1700
|
+
"social_history": value["social_history"] == null ? void 0 : value["social_history"].map(IntakeSocialHistoryToJSON),
|
|
1701
|
+
"surgical_history": value["surgical_history"] == null ? void 0 : value["surgical_history"].map(IntakeSurgeryToJSON),
|
|
1702
|
+
"vaccines": value["vaccines"] == null ? void 0 : value["vaccines"].map(IntakeVaccineToJSON)
|
|
1703
|
+
};
|
|
1704
|
+
}
|
|
1705
|
+
|
|
1706
|
+
// src/models/openapi-generated/patient/runtime.ts
|
|
1707
|
+
var BASE_PATH = "https://dev-api-patient.health.cloud".replace(/\/+$/, "");
|
|
1708
|
+
var Configuration = class {
|
|
1709
|
+
constructor(configuration = {}) {
|
|
1710
|
+
this.configuration = configuration;
|
|
1711
|
+
}
|
|
1712
|
+
set config(configuration) {
|
|
1713
|
+
this.configuration = configuration;
|
|
1714
|
+
}
|
|
1715
|
+
get basePath() {
|
|
1716
|
+
return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH;
|
|
1717
|
+
}
|
|
1718
|
+
get fetchApi() {
|
|
1719
|
+
return this.configuration.fetchApi;
|
|
1720
|
+
}
|
|
1721
|
+
get middleware() {
|
|
1722
|
+
return this.configuration.middleware || [];
|
|
1723
|
+
}
|
|
1724
|
+
get queryParamsStringify() {
|
|
1725
|
+
return this.configuration.queryParamsStringify || querystring;
|
|
1726
|
+
}
|
|
1727
|
+
get username() {
|
|
1728
|
+
return this.configuration.username;
|
|
1729
|
+
}
|
|
1730
|
+
get password() {
|
|
1731
|
+
return this.configuration.password;
|
|
1732
|
+
}
|
|
1733
|
+
get apiKey() {
|
|
1734
|
+
const apiKey = this.configuration.apiKey;
|
|
1735
|
+
if (apiKey) {
|
|
1736
|
+
return typeof apiKey === "function" ? apiKey : () => apiKey;
|
|
1737
|
+
}
|
|
1738
|
+
return void 0;
|
|
1739
|
+
}
|
|
1740
|
+
get accessToken() {
|
|
1741
|
+
const accessToken = this.configuration.accessToken;
|
|
1742
|
+
if (accessToken) {
|
|
1743
|
+
return typeof accessToken === "function" ? accessToken : async () => accessToken;
|
|
1744
|
+
}
|
|
1745
|
+
return void 0;
|
|
1746
|
+
}
|
|
1747
|
+
get headers() {
|
|
1748
|
+
return this.configuration.headers;
|
|
1749
|
+
}
|
|
1750
|
+
get credentials() {
|
|
1751
|
+
return this.configuration.credentials;
|
|
1752
|
+
}
|
|
1753
|
+
};
|
|
1754
|
+
var DefaultConfig = new Configuration();
|
|
1755
|
+
var _BaseAPI = class _BaseAPI {
|
|
1756
|
+
constructor(configuration = DefaultConfig) {
|
|
1757
|
+
this.configuration = configuration;
|
|
1758
|
+
this.fetchApi = async (url, init) => {
|
|
1759
|
+
let fetchParams = { url, init };
|
|
1760
|
+
for (const middleware of this.middleware) {
|
|
1761
|
+
if (middleware.pre) {
|
|
1762
|
+
fetchParams = await middleware.pre({
|
|
1763
|
+
fetch: this.fetchApi,
|
|
1764
|
+
...fetchParams
|
|
1765
|
+
}) || fetchParams;
|
|
1766
|
+
}
|
|
1767
|
+
}
|
|
1768
|
+
let response = void 0;
|
|
1769
|
+
try {
|
|
1770
|
+
response = await (this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init);
|
|
1771
|
+
} catch (e) {
|
|
1772
|
+
for (const middleware of this.middleware) {
|
|
1773
|
+
if (middleware.onError) {
|
|
1774
|
+
response = await middleware.onError({
|
|
1775
|
+
fetch: this.fetchApi,
|
|
1776
|
+
url: fetchParams.url,
|
|
1777
|
+
init: fetchParams.init,
|
|
1778
|
+
error: e,
|
|
1779
|
+
response: response ? response.clone() : void 0
|
|
1780
|
+
}) || response;
|
|
1781
|
+
}
|
|
1782
|
+
}
|
|
1783
|
+
if (response === void 0) {
|
|
1784
|
+
if (e instanceof Error) {
|
|
1785
|
+
throw new FetchError(e, "The request failed and the interceptors did not return an alternative response");
|
|
1786
|
+
} else {
|
|
1787
|
+
throw e;
|
|
1788
|
+
}
|
|
1789
|
+
}
|
|
1790
|
+
}
|
|
1791
|
+
for (const middleware of this.middleware) {
|
|
1792
|
+
if (middleware.post) {
|
|
1793
|
+
response = await middleware.post({
|
|
1794
|
+
fetch: this.fetchApi,
|
|
1795
|
+
url: fetchParams.url,
|
|
1796
|
+
init: fetchParams.init,
|
|
1797
|
+
response: response.clone()
|
|
1798
|
+
}) || response;
|
|
1799
|
+
}
|
|
1800
|
+
}
|
|
1801
|
+
return response;
|
|
1802
|
+
};
|
|
1803
|
+
this.middleware = configuration.middleware;
|
|
1804
|
+
}
|
|
1805
|
+
withMiddleware(...middlewares) {
|
|
1806
|
+
const next = this.clone();
|
|
1807
|
+
next.middleware = next.middleware.concat(...middlewares);
|
|
1808
|
+
return next;
|
|
1809
|
+
}
|
|
1810
|
+
withPreMiddleware(...preMiddlewares) {
|
|
1811
|
+
const middlewares = preMiddlewares.map((pre) => ({ pre }));
|
|
1812
|
+
return this.withMiddleware(...middlewares);
|
|
1813
|
+
}
|
|
1814
|
+
withPostMiddleware(...postMiddlewares) {
|
|
1815
|
+
const middlewares = postMiddlewares.map((post) => ({ post }));
|
|
1816
|
+
return this.withMiddleware(...middlewares);
|
|
1817
|
+
}
|
|
1818
|
+
/**
|
|
1819
|
+
* Check if the given MIME is a JSON MIME.
|
|
1820
|
+
* JSON MIME examples:
|
|
1821
|
+
* application/json
|
|
1822
|
+
* application/json; charset=UTF8
|
|
1823
|
+
* APPLICATION/JSON
|
|
1824
|
+
* application/vnd.company+json
|
|
1825
|
+
* @param mime - MIME (Multipurpose Internet Mail Extensions)
|
|
1826
|
+
* @return True if the given MIME is JSON, false otherwise.
|
|
1827
|
+
*/
|
|
1828
|
+
isJsonMime(mime) {
|
|
1829
|
+
if (!mime) {
|
|
1830
|
+
return false;
|
|
1831
|
+
}
|
|
1832
|
+
return _BaseAPI.jsonRegex.test(mime);
|
|
1833
|
+
}
|
|
1834
|
+
async request(context, initOverrides) {
|
|
1835
|
+
const { url, init } = await this.createFetchParams(context, initOverrides);
|
|
1836
|
+
const response = await this.fetchApi(url, init);
|
|
1837
|
+
if (response && (response.status >= 200 && response.status < 300)) {
|
|
1838
|
+
return response;
|
|
1839
|
+
}
|
|
1840
|
+
throw new ResponseError(response, "Response returned an error code");
|
|
1841
|
+
}
|
|
1842
|
+
async createFetchParams(context, initOverrides) {
|
|
1843
|
+
let url = this.configuration.basePath + context.path;
|
|
1844
|
+
if (context.query !== void 0 && Object.keys(context.query).length !== 0) {
|
|
1845
|
+
url += "?" + this.configuration.queryParamsStringify(context.query);
|
|
1846
|
+
}
|
|
1847
|
+
const headers = Object.assign({}, this.configuration.headers, context.headers);
|
|
1848
|
+
Object.keys(headers).forEach((key) => headers[key] === void 0 ? delete headers[key] : {});
|
|
1849
|
+
const initOverrideFn = typeof initOverrides === "function" ? initOverrides : async () => initOverrides;
|
|
1850
|
+
const initParams = {
|
|
1851
|
+
method: context.method,
|
|
1852
|
+
headers,
|
|
1853
|
+
body: context.body,
|
|
1854
|
+
credentials: this.configuration.credentials
|
|
1855
|
+
};
|
|
1856
|
+
const overriddenInit = {
|
|
1857
|
+
...initParams,
|
|
1858
|
+
...await initOverrideFn({
|
|
1859
|
+
init: initParams,
|
|
1860
|
+
context
|
|
1861
|
+
})
|
|
1862
|
+
};
|
|
1863
|
+
let body;
|
|
1864
|
+
if (isFormData(overriddenInit.body) || overriddenInit.body instanceof URLSearchParams || isBlob(overriddenInit.body)) {
|
|
1865
|
+
body = overriddenInit.body;
|
|
1866
|
+
} else if (this.isJsonMime(headers["Content-Type"])) {
|
|
1867
|
+
body = JSON.stringify(overriddenInit.body);
|
|
1868
|
+
} else {
|
|
1869
|
+
body = overriddenInit.body;
|
|
1870
|
+
}
|
|
1871
|
+
const init = {
|
|
1872
|
+
...overriddenInit,
|
|
1873
|
+
body
|
|
1874
|
+
};
|
|
1875
|
+
return { url, init };
|
|
1876
|
+
}
|
|
1877
|
+
/**
|
|
1878
|
+
* Create a shallow clone of `this` by constructing a new instance
|
|
1879
|
+
* and then shallow cloning data members.
|
|
1880
|
+
*/
|
|
1881
|
+
clone() {
|
|
1882
|
+
const constructor = this.constructor;
|
|
1883
|
+
const next = new constructor(this.configuration);
|
|
1884
|
+
next.middleware = this.middleware.slice();
|
|
1885
|
+
return next;
|
|
1886
|
+
}
|
|
1887
|
+
};
|
|
1888
|
+
_BaseAPI.jsonRegex = /^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$/i;
|
|
1889
|
+
var BaseAPI = _BaseAPI;
|
|
1890
|
+
function isBlob(value) {
|
|
1891
|
+
return typeof Blob !== "undefined" && value instanceof Blob;
|
|
1892
|
+
}
|
|
1893
|
+
function isFormData(value) {
|
|
1894
|
+
return typeof FormData !== "undefined" && value instanceof FormData;
|
|
1895
|
+
}
|
|
1896
|
+
var ResponseError = class extends Error {
|
|
1897
|
+
constructor(response, msg) {
|
|
1898
|
+
super(msg);
|
|
1899
|
+
this.response = response;
|
|
1900
|
+
this.name = "ResponseError";
|
|
1901
|
+
const actualProto = new.target.prototype;
|
|
1902
|
+
if (Object.setPrototypeOf) {
|
|
1903
|
+
Object.setPrototypeOf(this, actualProto);
|
|
1904
|
+
}
|
|
1905
|
+
}
|
|
1906
|
+
};
|
|
1907
|
+
var FetchError = class extends Error {
|
|
1908
|
+
constructor(cause, msg) {
|
|
1909
|
+
super(msg);
|
|
1910
|
+
this.cause = cause;
|
|
1911
|
+
this.name = "FetchError";
|
|
1912
|
+
const actualProto = new.target.prototype;
|
|
1913
|
+
if (Object.setPrototypeOf) {
|
|
1914
|
+
Object.setPrototypeOf(this, actualProto);
|
|
1915
|
+
}
|
|
1916
|
+
}
|
|
1917
|
+
};
|
|
1918
|
+
function querystring(params, prefix = "") {
|
|
1919
|
+
return Object.keys(params).map((key) => querystringSingleKey(key, params[key], prefix)).filter((part) => part.length > 0).join("&");
|
|
1920
|
+
}
|
|
1921
|
+
function querystringSingleKey(key, value, keyPrefix = "") {
|
|
1922
|
+
const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key);
|
|
1923
|
+
if (value instanceof Array) {
|
|
1924
|
+
const multiValue = value.map((singleValue) => encodeURIComponent(String(singleValue))).join(`&${encodeURIComponent(fullKey)}=`);
|
|
1925
|
+
return `${encodeURIComponent(fullKey)}=${multiValue}`;
|
|
1926
|
+
}
|
|
1927
|
+
if (value instanceof Set) {
|
|
1928
|
+
const valueAsArray = Array.from(value);
|
|
1929
|
+
return querystringSingleKey(key, valueAsArray, keyPrefix);
|
|
1930
|
+
}
|
|
1931
|
+
if (value instanceof Date) {
|
|
1932
|
+
return `${encodeURIComponent(fullKey)}=${encodeURIComponent(value.toISOString())}`;
|
|
1933
|
+
}
|
|
1934
|
+
if (value instanceof Object) {
|
|
1935
|
+
return querystring(value, fullKey);
|
|
1936
|
+
}
|
|
1937
|
+
return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`;
|
|
1938
|
+
}
|
|
1939
|
+
function mapValues(data, fn) {
|
|
1940
|
+
const result = {};
|
|
1941
|
+
for (const key of Object.keys(data)) {
|
|
1942
|
+
result[key] = fn(data[key]);
|
|
1943
|
+
}
|
|
1944
|
+
return result;
|
|
1945
|
+
}
|
|
1946
|
+
|
|
1947
|
+
// src/models/openapi-generated/patient/models/IntakeVendorSectionStatus.ts
|
|
1948
|
+
function IntakeVendorSectionStatusFromJSON(json) {
|
|
1949
|
+
return IntakeVendorSectionStatusFromJSONTyped(json, false);
|
|
1950
|
+
}
|
|
1951
|
+
function IntakeVendorSectionStatusFromJSONTyped(json, ignoreDiscriminator) {
|
|
1952
|
+
if (json == null) {
|
|
1953
|
+
return json;
|
|
1954
|
+
}
|
|
1955
|
+
return {
|
|
1956
|
+
"mode": json["mode"] == null ? void 0 : json["mode"],
|
|
1957
|
+
"reason": json["reason"] === void 0 ? void 0 : json["reason"] === null ? null : json["reason"],
|
|
1958
|
+
"reference": json["reference"] === void 0 ? void 0 : json["reference"] === null ? null : json["reference"],
|
|
1959
|
+
"status": json["status"]
|
|
1960
|
+
};
|
|
1961
|
+
}
|
|
1962
|
+
|
|
1963
|
+
// src/models/openapi-generated/patient/models/IntakeVendorStatus.ts
|
|
1964
|
+
function IntakeVendorStatusFromJSON(json) {
|
|
1965
|
+
return IntakeVendorStatusFromJSONTyped(json, false);
|
|
1966
|
+
}
|
|
1967
|
+
function IntakeVendorStatusFromJSONTyped(json, ignoreDiscriminator) {
|
|
1968
|
+
if (json == null) {
|
|
1969
|
+
return json;
|
|
1970
|
+
}
|
|
1971
|
+
return {
|
|
1972
|
+
"mode": json["mode"] == null ? void 0 : json["mode"],
|
|
1973
|
+
"reason": json["reason"] === void 0 ? void 0 : json["reason"] === null ? null : json["reason"],
|
|
1974
|
+
"reference": json["reference"] === void 0 ? void 0 : json["reference"] === null ? null : json["reference"],
|
|
1975
|
+
"section_results": json["section_results"] == null ? void 0 : mapValues(json["section_results"], IntakeVendorSectionStatusFromJSON),
|
|
1976
|
+
"sections": json["sections"] == null ? void 0 : json["sections"],
|
|
1977
|
+
"status": json["status"]
|
|
1978
|
+
};
|
|
1979
|
+
}
|
|
1980
|
+
|
|
1981
|
+
// src/models/openapi-generated/patient/models/PatientIntakeResponse.ts
|
|
1982
|
+
function PatientIntakeResponseFromJSON(json) {
|
|
1983
|
+
return PatientIntakeResponseFromJSONTyped(json, false);
|
|
1984
|
+
}
|
|
1985
|
+
function PatientIntakeResponseFromJSONTyped(json, ignoreDiscriminator) {
|
|
1986
|
+
if (json == null) {
|
|
1987
|
+
return json;
|
|
1988
|
+
}
|
|
1989
|
+
return {
|
|
1990
|
+
"created_at": new Date(json["created_at"]),
|
|
1991
|
+
"storage_status": json["storage_status"],
|
|
1992
|
+
"submission_id": json["submission_id"],
|
|
1993
|
+
"vendors": mapValues(json["vendors"], IntakeVendorStatusFromJSON)
|
|
1994
|
+
};
|
|
1995
|
+
}
|
|
1996
|
+
|
|
1048
1997
|
// src/clients/PatientClient.ts
|
|
1049
1998
|
var PatientClient = class extends BaseServiceClient {
|
|
1999
|
+
/** Add patient-reported history; each call creates a new server-identified submission. */
|
|
2000
|
+
async submitPatientIntake(request) {
|
|
2001
|
+
const response = await this.send("POST", "/patients/health-record/intake", {
|
|
2002
|
+
body: PatientIntakeRequestToJSON(request)
|
|
2003
|
+
});
|
|
2004
|
+
return PatientIntakeResponseFromJSON(response);
|
|
2005
|
+
}
|
|
2006
|
+
/** Read the authenticated patient's submission metadata and vendor section statuses. */
|
|
2007
|
+
async getPatientIntake(submissionId) {
|
|
2008
|
+
const response = await this.send("GET", "/patients/health-record/intake/{submission_id}", {
|
|
2009
|
+
pathParams: { submission_id: submissionId }
|
|
2010
|
+
});
|
|
2011
|
+
return PatientIntakeResponseFromJSON(response);
|
|
2012
|
+
}
|
|
1050
2013
|
constructor(http) {
|
|
1051
2014
|
super(http, "patient");
|
|
1052
2015
|
}
|