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