@healthcloudai/hc-sdk 2.6.2 → 2.8.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 +173 -0
- package/dist/index.d.cts +5950 -5764
- package/dist/index.d.ts +5950 -5764
- package/dist/index.js +173 -0
- package/docs/clients/EhrClient.md +15 -0
- package/docs/clients/PatientClient.md +3 -0
- package/docs/docs-manifest.json +62 -5
- package/docs/examples/index.md +18 -0
- package/docs/index.md +18 -0
- package/docs/models/AddInsuranceRequest.md +1 -0
- package/docs/models/AddInsuranceResponse.md +2 -0
- package/docs/models/Allergy.md +31 -0
- package/docs/models/AllergyCategory.md +15 -0
- package/docs/models/AllergyCriticality.md +15 -0
- package/docs/models/AllergyReaction.md +21 -0
- package/docs/models/AllergyStatus.md +15 -0
- package/docs/models/AllergyVerificationStatus.md +15 -0
- package/docs/models/Appointment.md +1 -0
- package/docs/models/AthenaAppointment.md +1 -0
- package/docs/models/BookAppointmentRequest.md +1 -0
- package/docs/models/CheckEncounterRequest.md +17 -0
- package/docs/models/CheckInEncounterRequest.md +17 -0
- package/docs/models/CodedConcept.md +19 -0
- package/docs/models/FamilyCondition.md +21 -0
- package/docs/models/FamilyHistoryEntry.md +30 -0
- package/docs/models/FamilyHistoryStatus.md +15 -0
- package/docs/models/FamilyRelationship.md +15 -0
- package/docs/models/GS1LookupResponse.md +3 -2
- package/docs/models/GetEncounterResponse.md +3 -0
- package/docs/models/GetHealthRecordResponse.md +19 -0
- package/docs/models/GetLatestEncounterResponse.md +17 -0
- package/docs/models/GetPatientResponse.md +2 -0
- package/docs/models/GetScanUploadUrlRequest.md +3 -2
- package/docs/models/GetTestResultResponse.md +20 -0
- package/docs/models/IntoleranceType.md +15 -0
- package/docs/models/ListAllergiesResponse.md +19 -0
- package/docs/models/ListConditionsResponse.md +19 -0
- package/docs/models/ListDirectivesResponse.md +19 -0
- package/docs/models/ListFamilyHistoryResponse.md +19 -0
- package/docs/models/ListFunctionalStatusResponse.md +19 -0
- package/docs/models/ListImmunizationsResponse.md +19 -0
- package/docs/models/ListObservationsResponse.md +19 -0
- package/docs/models/ListProceduresResponse.md +19 -0
- package/docs/models/ListQuestionnaireResponsesResponse.md +19 -0
- package/docs/models/ListSocialHistoryResponse.md +19 -0
- package/docs/models/ListVitalsResponse.md +19 -0
- package/docs/models/PatientDemographics.md +2 -0
- package/docs/models/Problem.md +37 -0
- package/docs/models/ProblemCategory.md +15 -0
- package/docs/models/ProblemClinicalStatus.md +15 -0
- package/docs/models/ProblemSeverity.md +15 -0
- package/docs/models/ProblemVerificationStatus.md +15 -0
- package/docs/models/QuestionnaireResponse.md +27 -0
- package/docs/models/QuestionnaireResponseStatus.md +15 -0
- package/docs/models/ReactionSeverity.md +15 -0
- package/docs/models/ResponseAnswer.md +27 -0
- package/docs/models/ResponseItem.md +21 -0
- package/docs/models/ScanUploadResponse.md +4 -4
- package/docs/models/Slot.md +1 -0
- package/docs/models/ehr.ListDiagnosticsResponse.md +19 -0
- package/docs/models/ehr.ListEncountersResponse.md +19 -0
- package/docs/models/ehr.ListMedicationsResponse.md +19 -0
- package/docs/models/fieldagent.Encounter.md +3 -0
- package/docs/models/index.md +41 -2
- package/docs/models/patient.Encounter.md +3 -0
- package/docs/operations/appointments.book.md +18 -15
- package/docs/operations/appointments.cancel.md +12 -11
- package/docs/operations/appointments.createSlot.md +44 -9
- package/docs/operations/appointments.listPatientAppointments.md +13 -12
- package/docs/operations/appointments.listSlots.md +9 -8
- package/docs/operations/appointments.reschedule.md +11 -10
- package/docs/operations/connectors.athenaBookAppointment.md +1 -0
- package/docs/operations/connectors.athenaCreateInsurancePackage.md +1 -1
- package/docs/operations/connectors.athenaGetAppointmentDetails.md +1 -0
- package/docs/operations/connectors.athenaGetBookedAppointments.md +1 -0
- package/docs/operations/connectors.athenaGetEncounter.md +1 -0
- package/docs/operations/connectors.athenaListAppointments.md +1 -0
- package/docs/operations/connectors.athenaListPatientAppointments.md +1 -0
- package/docs/operations/diagnostics.getScanUploadUrl.md +7 -5
- package/docs/operations/diagnostics.getTestResult.md +5 -23
- package/docs/operations/diagnostics.lookupTestByGs1.md +12 -6
- package/docs/operations/ehr.getHealthRecord.md +122 -0
- package/docs/operations/ehr.listAllergies.md +156 -0
- package/docs/operations/ehr.listConditions.md +152 -0
- package/docs/operations/ehr.listDiagnostics.md +147 -0
- package/docs/operations/ehr.listDirectives.md +122 -0
- package/docs/operations/ehr.listEncounters.md +178 -0
- package/docs/operations/ehr.listFamilyHistory.md +147 -0
- package/docs/operations/ehr.listFunctionalStatus.md +122 -0
- package/docs/operations/ehr.listImmunizations.md +122 -0
- package/docs/operations/ehr.listMedications.md +163 -0
- package/docs/operations/ehr.listObservations.md +126 -0
- package/docs/operations/ehr.listProcedures.md +122 -0
- package/docs/operations/ehr.listQuestionnaireResponses.md +162 -0
- package/docs/operations/ehr.listSocialHistory.md +122 -0
- package/docs/operations/ehr.listVitals.md +132 -0
- package/docs/operations/fieldagent.listEncounters.md +42 -39
- package/docs/operations/fieldagent.listPatients.md +60 -95
- package/docs/operations/patient.addInsurance.md +14 -10
- package/docs/operations/patient.checkEncounter.md +110 -0
- package/docs/operations/patient.checkInEncounter.md +173 -0
- package/docs/operations/patient.createEncounter.md +40 -37
- package/docs/operations/patient.getCheckinCheckin.md +41 -38
- package/docs/operations/patient.getCurrentCareSessionCareSessionsCurrent.md +43 -40
- package/docs/operations/patient.getEncounter.md +40 -37
- package/docs/operations/patient.getLatestEncounter.md +162 -0
- package/docs/operations/patient.getPatient.md +57 -92
- package/docs/operations/patient.getPatientSidebarPatientSidebar.md +97 -129
- package/docs/operations/patient.listEncounters.md +41 -38
- package/package.json +1 -1
- package/docs/models/PanelResult.md +0 -24
- package/docs/models/SingleTestResultResponse.md +0 -28
package/dist/index.cjs
CHANGED
|
@@ -325,6 +325,14 @@ var AppointmentsClient = class extends BaseServiceClient {
|
|
|
325
325
|
/**
|
|
326
326
|
* Book an appointment for a specific slot.
|
|
327
327
|
* POST /appointments/book
|
|
328
|
+
*
|
|
329
|
+
* On an Athena-integrated tenant the booking is made in Athena only — no
|
|
330
|
+
* local FHIR Appointment is written — and `athena_appointment_id` is
|
|
331
|
+
* **required**: take it from the `athena_appointment_id` of the chosen
|
|
332
|
+
* {@link listSlots} result, or the request is rejected. `slot_id` is still
|
|
333
|
+
* required by the generic pre-check; for Athena slots the same numeric id
|
|
334
|
+
* serves as both, since Athena reuses one id for a slot before and after
|
|
335
|
+
* booking.
|
|
328
336
|
*/
|
|
329
337
|
book(request) {
|
|
330
338
|
return this.send("POST", "/appointments/book", {
|
|
@@ -502,6 +510,109 @@ var EhrClient = class extends BaseServiceClient {
|
|
|
502
510
|
connect() {
|
|
503
511
|
return this.connectService();
|
|
504
512
|
}
|
|
513
|
+
// ─── Clinical Record ─────────────────────────────────────────────────
|
|
514
|
+
/** List a patient's allergies. */
|
|
515
|
+
listAllergies(patientId) {
|
|
516
|
+
return this.send("GET", "/patients/{patient_id}/allergies", {
|
|
517
|
+
pathParams: { patient_id: patientId }
|
|
518
|
+
});
|
|
519
|
+
}
|
|
520
|
+
/** List a patient's conditions. */
|
|
521
|
+
listConditions(patientId, clinicalStatus) {
|
|
522
|
+
return this.send("GET", "/patients/{patient_id}/conditions", {
|
|
523
|
+
pathParams: { patient_id: patientId },
|
|
524
|
+
query: clinicalStatus ? { clinical_status: clinicalStatus } : void 0
|
|
525
|
+
});
|
|
526
|
+
}
|
|
527
|
+
/** List a patient's diagnostic/lab observations. */
|
|
528
|
+
listDiagnostics(patientId, code) {
|
|
529
|
+
return this.send("GET", "/patients/{patient_id}/diagnostics", {
|
|
530
|
+
pathParams: { patient_id: patientId },
|
|
531
|
+
query: code ? { code } : void 0
|
|
532
|
+
});
|
|
533
|
+
}
|
|
534
|
+
/** List a patient's advance directives. */
|
|
535
|
+
listDirectives(patientId) {
|
|
536
|
+
return this.send("GET", "/patients/{patient_id}/directives", {
|
|
537
|
+
pathParams: { patient_id: patientId }
|
|
538
|
+
});
|
|
539
|
+
}
|
|
540
|
+
/** List a patient's encounters. */
|
|
541
|
+
listEncounters(patientId, status) {
|
|
542
|
+
return this.send("GET", "/patients/{patient_id}/encounters", {
|
|
543
|
+
pathParams: { patient_id: patientId },
|
|
544
|
+
query: status ? { status } : void 0
|
|
545
|
+
});
|
|
546
|
+
}
|
|
547
|
+
/** List a patient's family history. */
|
|
548
|
+
listFamilyHistory(patientId) {
|
|
549
|
+
return this.send("GET", "/patients/{patient_id}/family-history", {
|
|
550
|
+
pathParams: { patient_id: patientId }
|
|
551
|
+
});
|
|
552
|
+
}
|
|
553
|
+
/** List a patient's functional-status observations. */
|
|
554
|
+
listFunctionalStatus(patientId) {
|
|
555
|
+
return this.send("GET", "/patients/{patient_id}/functional-status", {
|
|
556
|
+
pathParams: { patient_id: patientId }
|
|
557
|
+
});
|
|
558
|
+
}
|
|
559
|
+
/** List a patient's immunizations. */
|
|
560
|
+
listImmunizations(patientId) {
|
|
561
|
+
return this.send("GET", "/patients/{patient_id}/immunizations", {
|
|
562
|
+
pathParams: { patient_id: patientId }
|
|
563
|
+
});
|
|
564
|
+
}
|
|
565
|
+
/** List a patient's medications. */
|
|
566
|
+
listMedications(patientId, resourceType) {
|
|
567
|
+
return this.send("GET", "/patients/{patient_id}/medications", {
|
|
568
|
+
pathParams: { patient_id: patientId },
|
|
569
|
+
query: resourceType ? { resource_type: resourceType } : void 0
|
|
570
|
+
});
|
|
571
|
+
}
|
|
572
|
+
/** List a patient's observations. */
|
|
573
|
+
listObservations(patientId, category) {
|
|
574
|
+
return this.send("GET", "/patients/{patient_id}/observations", {
|
|
575
|
+
pathParams: { patient_id: patientId },
|
|
576
|
+
query: category ? { category } : void 0
|
|
577
|
+
});
|
|
578
|
+
}
|
|
579
|
+
/** List a patient's procedures. */
|
|
580
|
+
listProcedures(patientId) {
|
|
581
|
+
return this.send("GET", "/patients/{patient_id}/procedures", {
|
|
582
|
+
pathParams: { patient_id: patientId }
|
|
583
|
+
});
|
|
584
|
+
}
|
|
585
|
+
/** List a patient's questionnaire responses. */
|
|
586
|
+
listQuestionnaireResponses(patientId, questionnaireUrl) {
|
|
587
|
+
return this.send("GET", "/patients/{patient_id}/questionnaire-responses", {
|
|
588
|
+
pathParams: { patient_id: patientId },
|
|
589
|
+
query: questionnaireUrl ? { questionnaire_url: questionnaireUrl } : void 0
|
|
590
|
+
});
|
|
591
|
+
}
|
|
592
|
+
/** Get a patient's consolidated health record. */
|
|
593
|
+
getHealthRecord(patientId) {
|
|
594
|
+
return this.send("GET", "/patients/{patient_id}/record", {
|
|
595
|
+
pathParams: { patient_id: patientId }
|
|
596
|
+
});
|
|
597
|
+
}
|
|
598
|
+
/** List a patient's social history. */
|
|
599
|
+
listSocialHistory(patientId) {
|
|
600
|
+
return this.send("GET", "/patients/{patient_id}/social-history", {
|
|
601
|
+
pathParams: { patient_id: patientId }
|
|
602
|
+
});
|
|
603
|
+
}
|
|
604
|
+
/** List a patient's vitals. */
|
|
605
|
+
listVitals(patientId, dateFrom, dateTo, type) {
|
|
606
|
+
const query = dateFrom || dateTo || type ? {
|
|
607
|
+
...dateFrom ? { date_from: dateFrom } : {},
|
|
608
|
+
...dateTo ? { date_to: dateTo } : {},
|
|
609
|
+
...type ? { type } : {}
|
|
610
|
+
} : void 0;
|
|
611
|
+
return this.send("GET", "/patients/{patient_id}/vitals", {
|
|
612
|
+
pathParams: { patient_id: patientId },
|
|
613
|
+
query
|
|
614
|
+
});
|
|
615
|
+
}
|
|
505
616
|
};
|
|
506
617
|
|
|
507
618
|
// src/clients/FieldAgentClient.ts
|
|
@@ -1241,11 +1352,73 @@ var PatientClient = class extends BaseServiceClient {
|
|
|
1241
1352
|
pathParams: { id: encounterId }
|
|
1242
1353
|
});
|
|
1243
1354
|
}
|
|
1355
|
+
/**
|
|
1356
|
+
* Open (or resume) the patient's visit right now — "the patient is here."
|
|
1357
|
+
*
|
|
1358
|
+
* Finds or creates their current open FHIR Encounter. On an Athena-integrated
|
|
1359
|
+
* tenant this additionally books a walk-in appointment for the current
|
|
1360
|
+
* moment, attaches the tenant's default self-pay insurance package, and
|
|
1361
|
+
* checks the patient in — all server-side, so no appointment id is needed.
|
|
1362
|
+
* Use {@link checkInEncounter} instead when you already hold one.
|
|
1363
|
+
*
|
|
1364
|
+
* Resolves with HTTP 200 even when the Athena leg failed: inspect
|
|
1365
|
+
* `athena_encounter_status` (and `athena_insurance_status`) rather than
|
|
1366
|
+
* treating a resolved promise as success. The endpoint retries the
|
|
1367
|
+
* book+check-in pair once on its own, because Athena legitimately rejects a
|
|
1368
|
+
* walk-in whose minute falls outside the provider's schedule template.
|
|
1369
|
+
*
|
|
1370
|
+
* Idempotent: an encounter already linked to Athena is returned as-is and is
|
|
1371
|
+
* never re-booked or re-checked-in.
|
|
1372
|
+
*/
|
|
1373
|
+
checkEncounter(request) {
|
|
1374
|
+
return this.send("POST", "/encounters/check", {
|
|
1375
|
+
body: request
|
|
1376
|
+
});
|
|
1377
|
+
}
|
|
1378
|
+
/**
|
|
1379
|
+
* Check the patient in against an appointment you already have (for example a
|
|
1380
|
+
* future slot booked earlier through `AppointmentsClient.bookAppointment`),
|
|
1381
|
+
* and link the resulting Athena encounter onto the FHIR Encounter.
|
|
1382
|
+
*
|
|
1383
|
+
* Does not create or book an appointment, and does not attach insurance —
|
|
1384
|
+
* use {@link checkEncounter} for the walk-in-now flow.
|
|
1385
|
+
*/
|
|
1386
|
+
checkInEncounter(encounterId, request) {
|
|
1387
|
+
return this.send("POST", "/encounters/{id}/check-in", {
|
|
1388
|
+
pathParams: { id: encounterId },
|
|
1389
|
+
body: request
|
|
1390
|
+
});
|
|
1391
|
+
}
|
|
1392
|
+
/**
|
|
1393
|
+
* Get the patient's latest still-open encounter, or `{ encounter: null }`
|
|
1394
|
+
* when none is open.
|
|
1395
|
+
*
|
|
1396
|
+
* On an Athena-integrated tenant Athena is authoritative: its encounter list
|
|
1397
|
+
* is read directly and matched back onto the local FHIR Encounter by
|
|
1398
|
+
* `athena_encounter_id`. A tenant-level read failure is surfaced as an error
|
|
1399
|
+
* rather than an empty result, so `{ encounter: null }` genuinely means "no
|
|
1400
|
+
* open encounter".
|
|
1401
|
+
*/
|
|
1402
|
+
getLatestEncounter(patientId) {
|
|
1403
|
+
return this.send("GET", "/patients/{patient_id}/encounters/latest", {
|
|
1404
|
+
pathParams: { patient_id: patientId }
|
|
1405
|
+
});
|
|
1406
|
+
}
|
|
1244
1407
|
createQuestionnaire(request) {
|
|
1245
1408
|
return this.send("POST", "/questionnaires", {
|
|
1246
1409
|
body: request
|
|
1247
1410
|
});
|
|
1248
1411
|
}
|
|
1412
|
+
/**
|
|
1413
|
+
* Create a FHIR QuestionnaireResponse, and on an Athena-integrated tenant also
|
|
1414
|
+
* append it as a note on the patient's open Athena encounter.
|
|
1415
|
+
*
|
|
1416
|
+
* The FHIR write always happens; the Athena note is additive and non-fatal, so
|
|
1417
|
+
* its outcome is reported on `athena_questionnaire_status` rather than
|
|
1418
|
+
* rejecting the call. `skipped_no_athena_encounter` means no Athena encounter
|
|
1419
|
+
* is open yet — notes attach to one, which only exists after check-in
|
|
1420
|
+
* ({@link checkEncounter}).
|
|
1421
|
+
*/
|
|
1249
1422
|
createQuestionnaireResponse(questionnaireId, request) {
|
|
1250
1423
|
return this.send("POST", "/questionnaires/{id}/responses", {
|
|
1251
1424
|
pathParams: { id: questionnaireId },
|