@awell-health/awell-extensions 2.0.151 → 2.0.153
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/extensions/cerner/actions/createPatient/__testdata__/CreateFhirPatient.mock.d.ts +8 -0
- package/dist/extensions/cerner/actions/createPatient/__testdata__/CreateFhirPatient.mock.js +12 -0
- package/dist/extensions/cerner/actions/createPatient/__testdata__/CreateFhirPatient.mock.js.map +1 -0
- package/dist/extensions/cerner/actions/createPatient/config/datapoints.d.ts +6 -1
- package/dist/extensions/cerner/actions/createPatient/config/datapoints.js +6 -1
- package/dist/extensions/cerner/actions/createPatient/config/datapoints.js.map +1 -1
- package/dist/extensions/cerner/actions/createPatient/config/fields.d.ts +70 -2
- package/dist/extensions/cerner/actions/createPatient/config/fields.js +61 -2
- package/dist/extensions/cerner/actions/createPatient/config/fields.js.map +1 -1
- package/dist/extensions/cerner/actions/createPatient/createPatient.js +61 -1
- package/dist/extensions/cerner/actions/createPatient/createPatient.js.map +1 -1
- package/dist/extensions/cerner/actions/getPatient/__testdata__/PatientRead.mock.d.ts +37 -0
- package/dist/extensions/cerner/actions/getPatient/__testdata__/PatientRead.mock.js +55 -0
- package/dist/extensions/cerner/actions/getPatient/__testdata__/PatientRead.mock.js.map +1 -0
- package/dist/extensions/cerner/actions/getPatient/config/datapoints.d.ts +6 -1
- package/dist/extensions/cerner/actions/getPatient/config/datapoints.js +6 -1
- package/dist/extensions/cerner/actions/getPatient/config/datapoints.js.map +1 -1
- package/dist/extensions/cerner/actions/getPatient/config/fields.d.ts +17 -2
- package/dist/extensions/cerner/actions/getPatient/config/fields.js +13 -2
- package/dist/extensions/cerner/actions/getPatient/config/fields.js.map +1 -1
- package/dist/extensions/cerner/actions/getPatient/getPatient.js +33 -2
- package/dist/extensions/cerner/actions/getPatient/getPatient.js.map +1 -1
- package/dist/extensions/cerner/actions/index.d.ts +31 -4
- package/dist/extensions/cerner/actions/index.js +2 -6
- package/dist/extensions/cerner/actions/index.js.map +1 -1
- package/dist/extensions/cerner/index.js +1 -1
- package/dist/extensions/cerner/index.js.map +1 -1
- package/dist/extensions/cerner/lib/api/FhirR4/FhirR4client-backup.d.ts +0 -0
- package/dist/extensions/cerner/lib/api/FhirR4/FhirR4client-backup.js +172 -0
- package/dist/extensions/cerner/lib/api/FhirR4/FhirR4client-backup.js.map +1 -0
- package/dist/extensions/cerner/lib/api/FhirR4/FhirR4client.d.ts +19 -0
- package/dist/extensions/cerner/lib/api/FhirR4/FhirR4client.js +45 -0
- package/dist/extensions/cerner/lib/api/FhirR4/FhirR4client.js.map +1 -0
- package/dist/extensions/cerner/lib/api/FhirR4/cacheService.d.ts +11 -0
- package/dist/extensions/cerner/lib/api/FhirR4/cacheService.js +15 -0
- package/dist/extensions/cerner/lib/api/FhirR4/cacheService.js.map +1 -0
- package/dist/extensions/cerner/lib/api/FhirR4/index.d.ts +1 -0
- package/dist/extensions/cerner/lib/api/FhirR4/index.js +18 -0
- package/dist/extensions/cerner/lib/api/FhirR4/index.js.map +1 -0
- package/dist/extensions/cerner/lib/api/FhirR4/schema/AppointmentRead.schema.d.ts +9 -0
- package/dist/extensions/cerner/lib/api/FhirR4/schema/AppointmentRead.schema.js +6 -0
- package/dist/extensions/cerner/lib/api/FhirR4/schema/AppointmentRead.schema.js.map +1 -0
- package/dist/extensions/cerner/lib/api/FhirR4/schema/DocumentReferenceCreate.schema.d.ts +7 -0
- package/dist/extensions/cerner/lib/api/FhirR4/schema/DocumentReferenceCreate.schema.js +3 -0
- package/dist/extensions/cerner/lib/api/FhirR4/schema/DocumentReferenceCreate.schema.js.map +1 -0
- package/dist/extensions/cerner/lib/api/FhirR4/schema/PatientCreate.schema.d.ts +7 -0
- package/dist/extensions/cerner/lib/api/FhirR4/schema/PatientCreate.schema.js +3 -0
- package/dist/extensions/cerner/lib/api/FhirR4/schema/PatientCreate.schema.js.map +1 -0
- package/dist/extensions/cerner/lib/api/FhirR4/schema/PatientMatch.schema.d.ts +37 -0
- package/dist/extensions/cerner/lib/api/FhirR4/schema/PatientMatch.schema.js +3 -0
- package/dist/extensions/cerner/lib/api/FhirR4/schema/PatientMatch.schema.js.map +1 -0
- package/dist/extensions/cerner/lib/api/FhirR4/schema/PatientRead.schema.d.ts +9 -0
- package/dist/extensions/cerner/lib/api/FhirR4/schema/PatientRead.schema.js +6 -0
- package/dist/extensions/cerner/lib/api/FhirR4/schema/PatientRead.schema.js.map +1 -0
- package/dist/extensions/cerner/lib/api/FhirR4/schema/PatientSearch.schema.d.ts +8 -0
- package/dist/extensions/cerner/lib/api/FhirR4/schema/PatientSearch.schema.js +3 -0
- package/dist/extensions/cerner/lib/api/FhirR4/schema/PatientSearch.schema.js.map +1 -0
- package/dist/extensions/cerner/lib/api/FhirR4/schema/index.d.ts +6 -0
- package/dist/extensions/cerner/lib/api/FhirR4/schema/index.js +23 -0
- package/dist/extensions/cerner/lib/api/FhirR4/schema/index.js.map +1 -0
- package/dist/extensions/cerner/lib/api/auth/constructCernerUrls.d.ts +4 -0
- package/dist/extensions/cerner/lib/api/auth/constructCernerUrls.js +11 -0
- package/dist/extensions/cerner/lib/api/auth/constructCernerUrls.js.map +1 -0
- package/dist/extensions/cerner/lib/api/auth/index.d.ts +1 -0
- package/dist/extensions/cerner/lib/api/auth/index.js +18 -0
- package/dist/extensions/cerner/lib/api/auth/index.js.map +1 -0
- package/dist/extensions/cerner/lib/validatePayloadAndCreateSdks.d.ts +18 -0
- package/dist/extensions/cerner/lib/validatePayloadAndCreateSdks.js +41 -0
- package/dist/extensions/cerner/lib/validatePayloadAndCreateSdks.js.map +1 -0
- package/dist/extensions/cerner/settings.d.ts +36 -2
- package/dist/extensions/cerner/settings.js +28 -2
- package/dist/extensions/cerner/settings.js.map +1 -1
- package/dist/extensions/dockHealth/lib/dock.types.d.ts +2 -2
- package/dist/extensions/elation/actions/findAppointmentsByPrompt/findAppointmentsByPrompt.js +33 -113
- package/dist/extensions/elation/actions/findAppointmentsByPrompt/findAppointmentsByPrompt.js.map +1 -1
- package/dist/extensions/elation/actions/findAppointmentsByPrompt/getAppoitnmentCountByStatus.d.ts +2 -0
- package/dist/extensions/elation/actions/findAppointmentsByPrompt/getAppoitnmentCountByStatus.js +15 -0
- package/dist/extensions/elation/actions/findAppointmentsByPrompt/getAppoitnmentCountByStatus.js.map +1 -0
- package/dist/extensions/elation/actions/findAppointmentsByPrompt/lib/findAppointmentsByPromptWithLLM/findAppointmentsByPromptWithLLM.d.ts +14 -0
- package/dist/extensions/elation/actions/findAppointmentsByPrompt/lib/findAppointmentsByPromptWithLLM/findAppointmentsByPromptWithLLM.js +36 -0
- package/dist/extensions/elation/actions/findAppointmentsByPrompt/lib/findAppointmentsByPromptWithLLM/findAppointmentsByPromptWithLLM.js.map +1 -0
- package/dist/extensions/elation/actions/findAppointmentsByPrompt/lib/findAppointmentsByPromptWithLLM/parser.d.ts +17 -0
- package/dist/extensions/elation/actions/findAppointmentsByPrompt/lib/findAppointmentsByPromptWithLLM/parser.js +14 -0
- package/dist/extensions/elation/actions/findAppointmentsByPrompt/lib/findAppointmentsByPromptWithLLM/parser.js.map +1 -0
- package/dist/extensions/elation/actions/findAppointmentsByPrompt/lib/findAppointmentsByPromptWithLLM/prompt.d.ts +2 -0
- package/dist/extensions/elation/actions/findAppointmentsByPrompt/lib/findAppointmentsByPromptWithLLM/prompt.js +24 -0
- package/dist/extensions/elation/actions/findAppointmentsByPrompt/lib/findAppointmentsByPromptWithLLM/prompt.js.map +1 -0
- package/dist/extensions/elation/actions/findFutureAppointment/findFutureAppointment.d.ts +1 -1
- package/dist/extensions/elation/actions/findFutureAppointment/findFutureAppointment.js +32 -90
- package/dist/extensions/elation/actions/findFutureAppointment/findFutureAppointment.js.map +1 -1
- package/dist/extensions/elation/actions/findFutureAppointment/formatAppointments.d.ts +2 -0
- package/dist/extensions/elation/actions/findFutureAppointment/formatAppointments.js +18 -0
- package/dist/extensions/elation/actions/findFutureAppointment/formatAppointments.js.map +1 -0
- package/dist/extensions/elation/actions/findFutureAppointment/getFutureAppoitnments.d.ts +3 -0
- package/dist/extensions/elation/actions/findFutureAppointment/getFutureAppoitnments.js +15 -0
- package/dist/extensions/elation/actions/findFutureAppointment/getFutureAppoitnments.js.map +1 -0
- package/dist/extensions/elation/actions/findFutureAppointment/lib/findAppointmentWithLLM/findAppointmentWithLLM.d.ts +14 -0
- package/dist/extensions/elation/actions/findFutureAppointment/lib/findAppointmentWithLLM/findAppointmentWithLLM.js +29 -0
- package/dist/extensions/elation/actions/findFutureAppointment/lib/findAppointmentWithLLM/findAppointmentWithLLM.js.map +1 -0
- package/dist/extensions/elation/actions/findFutureAppointment/lib/findAppointmentWithLLM/parser.d.ts +17 -0
- package/dist/extensions/elation/actions/findFutureAppointment/lib/findAppointmentWithLLM/parser.js +16 -0
- package/dist/extensions/elation/actions/findFutureAppointment/lib/findAppointmentWithLLM/parser.js.map +1 -0
- package/dist/extensions/elation/actions/findFutureAppointment/lib/findAppointmentWithLLM/prompt.d.ts +2 -0
- package/dist/extensions/elation/actions/findFutureAppointment/lib/findAppointmentWithLLM/prompt.js +20 -0
- package/dist/extensions/elation/actions/findFutureAppointment/lib/findAppointmentWithLLM/prompt.js.map +1 -0
- package/dist/extensions/elation/actions/index.d.ts +0 -210
- package/dist/extensions/elation/actions/updatePatientTags/config/types.d.ts +29 -0
- package/dist/extensions/elation/actions/updatePatientTags/config/types.js +21 -0
- package/dist/extensions/elation/actions/updatePatientTags/config/types.js.map +1 -0
- package/dist/extensions/elation/actions/updatePatientTags/lib/getTagsFromLLM/getTagsFromLLM.d.ts +13 -0
- package/dist/extensions/elation/actions/updatePatientTags/lib/getTagsFromLLM/getTagsFromLLM.js +29 -0
- package/dist/extensions/elation/actions/updatePatientTags/lib/getTagsFromLLM/getTagsFromLLM.js.map +1 -0
- package/dist/extensions/elation/actions/updatePatientTags/lib/getTagsFromLLM/parser.d.ts +13 -0
- package/dist/extensions/elation/actions/updatePatientTags/lib/getTagsFromLLM/parser.js +7 -0
- package/dist/extensions/elation/actions/updatePatientTags/lib/getTagsFromLLM/parser.js.map +1 -0
- package/dist/extensions/elation/actions/updatePatientTags/lib/getTagsFromLLM/prompt.d.ts +2 -0
- package/dist/extensions/elation/actions/updatePatientTags/lib/getTagsFromLLM/prompt.js +22 -0
- package/dist/extensions/elation/actions/updatePatientTags/lib/getTagsFromLLM/prompt.js.map +1 -0
- package/dist/extensions/elation/actions/updatePatientTags/updatePatientTags.d.ts +8 -0
- package/dist/extensions/elation/actions/updatePatientTags/updatePatientTags.js +35 -77
- package/dist/extensions/elation/actions/updatePatientTags/updatePatientTags.js.map +1 -1
- package/dist/extensions/elation/actions/updatePatientTags/updateTags.d.ts +2 -0
- package/dist/extensions/elation/actions/updatePatientTags/updateTags.js +18 -0
- package/dist/extensions/elation/actions/updatePatientTags/updateTags.js.map +1 -0
- package/dist/extensions/elation/settings.d.ts +1 -10
- package/dist/extensions/elation/settings.js +0 -8
- package/dist/extensions/elation/settings.js.map +1 -1
- package/dist/extensions/elation/validation/referralOrder.zod.d.ts +17 -17
- package/dist/extensions/epic/actions/createClinicalNote/config/fields.js +1 -1
- package/dist/extensions/epic/actions/createClinicalNote/config/fields.js.map +1 -1
- package/dist/extensions/epic/actions/createClinicalNote/createClinicalNote.js +1 -1
- package/dist/extensions/epic/actions/createClinicalNote/createClinicalNote.js.map +1 -1
- package/dist/extensions/epic/actions/createPatient/config/fields.js +1 -1
- package/dist/extensions/epic/actions/createPatient/config/fields.js.map +1 -1
- package/dist/extensions/epic/actions/matchPatient/config/fields.js +1 -1
- package/dist/extensions/epic/actions/matchPatient/config/fields.js.map +1 -1
- package/dist/extensions/epic/lib/api/customFhirSchemas/DocumentReference/Status.schema.js.map +1 -0
- package/dist/extensions/epic/lib/api/customFhirSchemas/DocumentReference/Type.schema.js.map +1 -0
- package/dist/extensions/epic/lib/api/{schemas → customFhirSchemas}/DocumentReference/index.js +1 -1
- package/dist/extensions/epic/lib/api/customFhirSchemas/DocumentReference/index.js.map +1 -0
- package/dist/extensions/markdown.json +1 -1
- package/dist/extensions/medplum/actions/createServiceRequest/config/fields.js +4 -6
- package/dist/extensions/medplum/actions/createServiceRequest/config/fields.js.map +1 -1
- package/dist/extensions/medplum/actions/createTask/config/fields.js +4 -6
- package/dist/extensions/medplum/actions/createTask/config/fields.js.map +1 -1
- package/dist/extensions/medplum/fhir/schemas/resources/patient.schema.js +2 -2
- package/dist/extensions/medplum/fhir/schemas/resources/patient.schema.js.map +1 -1
- package/dist/extensions/medplum/fhir/schemas/resources/serviceRequest.schema.js +5 -5
- package/dist/extensions/medplum/fhir/schemas/resources/serviceRequest.schema.js.map +1 -1
- package/dist/extensions/medplum/fhir/schemas/resources/task.schema.js +4 -4
- package/dist/extensions/medplum/fhir/schemas/resources/task.schema.js.map +1 -1
- package/dist/extensions/shelly/actions/categorizeMessage/categorizeMessage.d.ts +10 -2
- package/dist/extensions/shelly/actions/categorizeMessage/categorizeMessage.js +32 -24
- package/dist/extensions/shelly/actions/categorizeMessage/categorizeMessage.js.map +1 -1
- package/dist/extensions/shelly/actions/categorizeMessage/lib/categorizeMessageWithLLM/categorizeMessageWithLLM.d.ts +22 -2
- package/dist/extensions/shelly/actions/categorizeMessage/lib/categorizeMessageWithLLM/categorizeMessageWithLLM.js +22 -7
- package/dist/extensions/shelly/actions/categorizeMessage/lib/categorizeMessageWithLLM/categorizeMessageWithLLM.js.map +1 -1
- package/dist/extensions/shelly/actions/categorizeMessage/lib/categorizeMessageWithLLM/parser.d.ts +20 -0
- package/dist/extensions/shelly/actions/categorizeMessage/lib/categorizeMessageWithLLM/parser.js +18 -0
- package/dist/extensions/shelly/actions/categorizeMessage/lib/categorizeMessageWithLLM/parser.js.map +1 -0
- package/dist/extensions/shelly/actions/categorizeMessage/lib/categorizeMessageWithLLM/prompt.d.ts +13 -0
- package/dist/extensions/shelly/actions/categorizeMessage/lib/categorizeMessageWithLLM/prompt.js +35 -0
- package/dist/extensions/shelly/actions/categorizeMessage/lib/categorizeMessageWithLLM/prompt.js.map +1 -0
- package/dist/extensions/shelly/actions/generateMessage/generateMessage.d.ts +10 -2
- package/dist/extensions/shelly/actions/generateMessage/generateMessage.js +33 -25
- package/dist/extensions/shelly/actions/generateMessage/generateMessage.js.map +1 -1
- package/dist/extensions/shelly/actions/generateMessage/lib/generateMessageWithLLM/generateMessageWithLLM.d.ts +18 -2
- package/dist/extensions/shelly/actions/generateMessage/lib/generateMessageWithLLM/generateMessageWithLLM.js +23 -10
- package/dist/extensions/shelly/actions/generateMessage/lib/generateMessageWithLLM/generateMessageWithLLM.js.map +1 -1
- package/dist/extensions/shelly/actions/generateMessage/lib/generateMessageWithLLM/parser.d.ts +28 -0
- package/dist/extensions/shelly/actions/generateMessage/lib/generateMessageWithLLM/parser.js +17 -0
- package/dist/extensions/shelly/actions/generateMessage/lib/generateMessageWithLLM/parser.js.map +1 -0
- package/dist/extensions/shelly/actions/generateMessage/lib/generateMessageWithLLM/prompt.d.ts +10 -0
- package/dist/extensions/shelly/actions/generateMessage/lib/generateMessageWithLLM/prompt.js +121 -0
- package/dist/extensions/shelly/actions/generateMessage/lib/generateMessageWithLLM/prompt.js.map +1 -0
- package/dist/extensions/shelly/actions/index.d.ts +7 -63
- package/dist/extensions/shelly/actions/medicationFromImage/medicationFromImage.d.ts +1 -2
- package/dist/extensions/shelly/actions/medicationFromImage/medicationFromImage.js.map +1 -1
- package/dist/extensions/shelly/actions/reviewMedicationExtraction/reviewMedicationExtraction.d.ts +1 -2
- package/dist/extensions/shelly/actions/reviewMedicationExtraction/reviewMedicationExtraction.js.map +1 -1
- package/dist/extensions/shelly/actions/summarizeCareFlow/lib/summarizeCareFlowWithLLM/{constants.js → prompt.js} +1 -1
- package/dist/extensions/shelly/actions/summarizeCareFlow/lib/summarizeCareFlowWithLLM/prompt.js.map +1 -0
- package/dist/extensions/shelly/actions/summarizeCareFlow/lib/summarizeCareFlowWithLLM/summarizeCareFlowWithLLM.d.ts +22 -2
- package/dist/extensions/shelly/actions/summarizeCareFlow/lib/summarizeCareFlowWithLLM/summarizeCareFlowWithLLM.js +30 -8
- package/dist/extensions/shelly/actions/summarizeCareFlow/lib/summarizeCareFlowWithLLM/summarizeCareFlowWithLLM.js.map +1 -1
- package/dist/extensions/shelly/actions/summarizeCareFlow/summarizeCareFlow.d.ts +1 -2
- package/dist/extensions/shelly/actions/summarizeCareFlow/summarizeCareFlow.js +24 -21
- package/dist/extensions/shelly/actions/summarizeCareFlow/summarizeCareFlow.js.map +1 -1
- package/dist/extensions/shelly/actions/summarizeForm/summarizeForm.d.ts +10 -2
- package/dist/extensions/shelly/actions/summarizeForm/summarizeForm.js +42 -28
- package/dist/extensions/shelly/actions/summarizeForm/summarizeForm.js.map +1 -1
- package/dist/extensions/shelly/actions/summarizeFormsInStep/summarizeFormsInStep.d.ts +1 -2
- package/dist/extensions/shelly/actions/summarizeFormsInStep/summarizeFormsInStep.js +29 -26
- package/dist/extensions/shelly/actions/summarizeFormsInStep/summarizeFormsInStep.js.map +1 -1
- package/dist/extensions/shelly/index.js +2 -3
- package/dist/extensions/shelly/index.js.map +1 -1
- package/dist/extensions/shelly/lib/summarizeFormWithLLM/{constants.js → prompt.js} +1 -1
- package/dist/extensions/shelly/lib/summarizeFormWithLLM/prompt.js.map +1 -0
- package/dist/extensions/shelly/lib/summarizeFormWithLLM/summarizeFormWithLLM.d.ts +23 -2
- package/dist/extensions/shelly/lib/summarizeFormWithLLM/summarizeFormWithLLM.js +33 -9
- package/dist/extensions/shelly/lib/summarizeFormWithLLM/summarizeFormWithLLM.js.map +1 -1
- package/dist/extensions/shelly/lib/validatePayloadAndCreateSdk.d.ts +1 -5
- package/dist/extensions/shelly/lib/validatePayloadAndCreateSdk.js +5 -20
- package/dist/extensions/shelly/lib/validatePayloadAndCreateSdk.js.map +1 -1
- package/dist/extensions/zendesk/v1/actions/createTask/config/fields.d.ts +2 -2
- package/dist/src/lib/fhir/schemas/Appointment/Status.schema.js.map +1 -0
- package/dist/src/lib/fhir/schemas/Appointment/index.js.map +1 -0
- package/dist/src/lib/fhir/schemas/Patient/Gender.schema.js.map +1 -0
- package/dist/src/lib/fhir/schemas/Patient/index.js.map +1 -0
- package/dist/{extensions/medplum/fhir/schemas/atoms/IntentSchema.d.ts → src/lib/fhir/schemas/ServiceRequest/Intent.schema.d.ts} +0 -1
- package/dist/{extensions/medplum/fhir/schemas/atoms/IntentSchema.js → src/lib/fhir/schemas/ServiceRequest/Intent.schema.js} +2 -13
- package/dist/src/lib/fhir/schemas/ServiceRequest/Intent.schema.js.map +1 -0
- package/dist/{extensions/medplum/fhir/schemas/atoms/PrioritySchema.js → src/lib/fhir/schemas/ServiceRequest/Priority.schema.js} +1 -1
- package/dist/src/lib/fhir/schemas/ServiceRequest/Priority.schema.js.map +1 -0
- package/dist/src/lib/fhir/schemas/ServiceRequest/Status.schema.d.ts +2 -0
- package/dist/src/lib/fhir/schemas/ServiceRequest/Status.schema.js +14 -0
- package/dist/src/lib/fhir/schemas/ServiceRequest/Status.schema.js.map +1 -0
- package/dist/src/lib/fhir/schemas/ServiceRequest/index.d.ts +3 -0
- package/dist/src/lib/fhir/schemas/ServiceRequest/index.js +20 -0
- package/dist/src/lib/fhir/schemas/ServiceRequest/index.js.map +1 -0
- package/dist/src/lib/fhir/schemas/Shared/PeriodSchema.js.map +1 -0
- package/dist/src/lib/fhir/schemas/Shared/index.d.ts +1 -0
- package/dist/src/lib/fhir/schemas/Shared/index.js +18 -0
- package/dist/src/lib/fhir/schemas/Shared/index.js.map +1 -0
- package/dist/src/lib/fhir/schemas/Task/IntentSchema.d.ts +2 -0
- package/dist/src/lib/fhir/schemas/Task/IntentSchema.js +16 -0
- package/dist/src/lib/fhir/schemas/Task/IntentSchema.js.map +1 -0
- package/dist/src/lib/fhir/schemas/Task/Priority.schema.d.ts +2 -0
- package/dist/src/lib/fhir/schemas/Task/Priority.schema.js +6 -0
- package/dist/src/lib/fhir/schemas/Task/Priority.schema.js.map +1 -0
- package/dist/{extensions/medplum/fhir/schemas/atoms/StatusSchema.d.ts → src/lib/fhir/schemas/Task/Status.schema.d.ts} +0 -1
- package/dist/{extensions/medplum/fhir/schemas/atoms/StatusSchema.js → src/lib/fhir/schemas/Task/Status.schema.js} +2 -11
- package/dist/src/lib/fhir/schemas/Task/Status.schema.js.map +1 -0
- package/dist/src/lib/fhir/schemas/Task/index.d.ts +3 -0
- package/dist/src/lib/fhir/schemas/Task/index.js +20 -0
- package/dist/src/lib/fhir/schemas/Task/index.js.map +1 -0
- package/dist/src/lib/llm/openai/constants.d.ts +28 -0
- package/dist/src/lib/llm/openai/constants.js +32 -0
- package/dist/src/lib/llm/openai/constants.js.map +1 -0
- package/dist/src/lib/llm/openai/createOpenAIModel.d.ts +23 -0
- package/dist/src/lib/llm/openai/createOpenAIModel.js +89 -0
- package/dist/src/lib/llm/openai/createOpenAIModel.js.map +1 -0
- package/dist/src/lib/llm/openai/index.d.ts +3 -0
- package/dist/src/lib/llm/openai/index.js +20 -0
- package/dist/src/lib/llm/openai/index.js.map +1 -0
- package/dist/src/lib/llm/openai/types.d.ts +63 -0
- package/dist/src/lib/llm/openai/types.js +3 -0
- package/dist/src/lib/llm/openai/types.js.map +1 -0
- package/package.json +5 -4
- package/dist/extensions/cerner/actions/createClinicalNote/config/datapoints.d.ts +0 -1
- package/dist/extensions/cerner/actions/createClinicalNote/config/datapoints.js +0 -5
- package/dist/extensions/cerner/actions/createClinicalNote/config/datapoints.js.map +0 -1
- package/dist/extensions/cerner/actions/createClinicalNote/config/fields.d.ts +0 -3
- package/dist/extensions/cerner/actions/createClinicalNote/config/fields.js +0 -10
- package/dist/extensions/cerner/actions/createClinicalNote/config/fields.js.map +0 -1
- package/dist/extensions/cerner/actions/createClinicalNote/config/index.d.ts +0 -2
- package/dist/extensions/cerner/actions/createClinicalNote/config/index.js +0 -9
- package/dist/extensions/cerner/actions/createClinicalNote/config/index.js.map +0 -1
- package/dist/extensions/cerner/actions/createClinicalNote/createClinicalNote.d.ts +0 -4
- package/dist/extensions/cerner/actions/createClinicalNote/createClinicalNote.js +0 -18
- package/dist/extensions/cerner/actions/createClinicalNote/createClinicalNote.js.map +0 -1
- package/dist/extensions/cerner/actions/createClinicalNote/index.d.ts +0 -1
- package/dist/extensions/cerner/actions/createClinicalNote/index.js +0 -6
- package/dist/extensions/cerner/actions/createClinicalNote/index.js.map +0 -1
- package/dist/extensions/cerner/actions/getAppointment/config/datapoints.d.ts +0 -1
- package/dist/extensions/cerner/actions/getAppointment/config/datapoints.js +0 -5
- package/dist/extensions/cerner/actions/getAppointment/config/datapoints.js.map +0 -1
- package/dist/extensions/cerner/actions/getAppointment/config/fields.d.ts +0 -3
- package/dist/extensions/cerner/actions/getAppointment/config/fields.js +0 -10
- package/dist/extensions/cerner/actions/getAppointment/config/fields.js.map +0 -1
- package/dist/extensions/cerner/actions/getAppointment/config/index.d.ts +0 -2
- package/dist/extensions/cerner/actions/getAppointment/config/index.js +0 -9
- package/dist/extensions/cerner/actions/getAppointment/config/index.js.map +0 -1
- package/dist/extensions/cerner/actions/getAppointment/getAppointment.d.ts +0 -4
- package/dist/extensions/cerner/actions/getAppointment/getAppointment.js +0 -18
- package/dist/extensions/cerner/actions/getAppointment/getAppointment.js.map +0 -1
- package/dist/extensions/cerner/actions/getAppointment/index.d.ts +0 -1
- package/dist/extensions/cerner/actions/getAppointment/index.js +0 -6
- package/dist/extensions/cerner/actions/getAppointment/index.js.map +0 -1
- package/dist/extensions/epic/lib/api/schemas/Appointment/Status.schema.js.map +0 -1
- package/dist/extensions/epic/lib/api/schemas/Appointment/index.js.map +0 -1
- package/dist/extensions/epic/lib/api/schemas/DocumentReference/Status.schema.js.map +0 -1
- package/dist/extensions/epic/lib/api/schemas/DocumentReference/Type.schema.js.map +0 -1
- package/dist/extensions/epic/lib/api/schemas/DocumentReference/index.js.map +0 -1
- package/dist/extensions/epic/lib/api/schemas/Patient/Gender.schema.js.map +0 -1
- package/dist/extensions/epic/lib/api/schemas/Patient/index.js.map +0 -1
- package/dist/extensions/medplum/fhir/schemas/atoms/GenderSchema.d.ts +0 -2
- package/dist/extensions/medplum/fhir/schemas/atoms/GenderSchema.js +0 -6
- package/dist/extensions/medplum/fhir/schemas/atoms/GenderSchema.js.map +0 -1
- package/dist/extensions/medplum/fhir/schemas/atoms/IntentSchema.js.map +0 -1
- package/dist/extensions/medplum/fhir/schemas/atoms/PeriodSchema.js.map +0 -1
- package/dist/extensions/medplum/fhir/schemas/atoms/PrioritySchema.js.map +0 -1
- package/dist/extensions/medplum/fhir/schemas/atoms/StatusSchema.js.map +0 -1
- package/dist/extensions/medplum/fhir/schemas/atoms/index.d.ts +0 -5
- package/dist/extensions/medplum/fhir/schemas/atoms/index.js +0 -16
- package/dist/extensions/medplum/fhir/schemas/atoms/index.js.map +0 -1
- package/dist/extensions/shelly/actions/categorizeMessage/lib/categorizeMessageWithLLM/constants.d.ts +0 -24
- package/dist/extensions/shelly/actions/categorizeMessage/lib/categorizeMessageWithLLM/constants.js +0 -33
- package/dist/extensions/shelly/actions/categorizeMessage/lib/categorizeMessageWithLLM/constants.js.map +0 -1
- package/dist/extensions/shelly/actions/generateMessage/lib/generateMessageWithLLM/constants.d.ts +0 -24
- package/dist/extensions/shelly/actions/generateMessage/lib/generateMessageWithLLM/constants.js +0 -123
- package/dist/extensions/shelly/actions/generateMessage/lib/generateMessageWithLLM/constants.js.map +0 -1
- package/dist/extensions/shelly/actions/summarizeCareFlow/lib/summarizeCareFlowWithLLM/constants.js.map +0 -1
- package/dist/extensions/shelly/lib/summarizeFormWithLLM/constants.js.map +0 -1
- package/dist/extensions/shelly/settings.d.ts +0 -17
- package/dist/extensions/shelly/settings.js +0 -17
- package/dist/extensions/shelly/settings.js.map +0 -1
- package/dist/extensions/epic/lib/api/{schemas → customFhirSchemas}/DocumentReference/Status.schema.d.ts +0 -0
- package/dist/extensions/epic/lib/api/{schemas → customFhirSchemas}/DocumentReference/Status.schema.js +0 -0
- package/dist/extensions/epic/lib/api/{schemas → customFhirSchemas}/DocumentReference/Type.schema.d.ts +0 -0
- package/dist/extensions/epic/lib/api/{schemas → customFhirSchemas}/DocumentReference/Type.schema.js +0 -0
- package/dist/extensions/epic/lib/api/{schemas → customFhirSchemas}/DocumentReference/index.d.ts +1 -1
- /package/dist/extensions/shelly/actions/summarizeCareFlow/lib/summarizeCareFlowWithLLM/{constants.d.ts → prompt.d.ts} +0 -0
- /package/dist/extensions/shelly/lib/summarizeFormWithLLM/{constants.d.ts → prompt.d.ts} +0 -0
- /package/dist/{extensions/epic/lib/api → src/lib/fhir}/schemas/Appointment/Status.schema.d.ts +0 -0
- /package/dist/{extensions/epic/lib/api → src/lib/fhir}/schemas/Appointment/Status.schema.js +0 -0
- /package/dist/{extensions/epic/lib/api → src/lib/fhir}/schemas/Appointment/index.d.ts +0 -0
- /package/dist/{extensions/epic/lib/api → src/lib/fhir}/schemas/Appointment/index.js +0 -0
- /package/dist/{extensions/epic/lib/api → src/lib/fhir}/schemas/Patient/Gender.schema.d.ts +0 -0
- /package/dist/{extensions/epic/lib/api → src/lib/fhir}/schemas/Patient/Gender.schema.js +0 -0
- /package/dist/{extensions/epic/lib/api → src/lib/fhir}/schemas/Patient/index.d.ts +0 -0
- /package/dist/{extensions/epic/lib/api → src/lib/fhir}/schemas/Patient/index.js +0 -0
- /package/dist/{extensions/medplum/fhir/schemas/atoms/PrioritySchema.d.ts → src/lib/fhir/schemas/ServiceRequest/Priority.schema.d.ts} +0 -0
- /package/dist/{extensions/medplum/fhir/schemas/atoms → src/lib/fhir/schemas/Shared}/PeriodSchema.d.ts +0 -0
- /package/dist/{extensions/medplum/fhir/schemas/atoms → src/lib/fhir/schemas/Shared}/PeriodSchema.js +0 -0
@@ -1,48 +1,29 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.findFutureAppointment = void 0;
|
4
|
+
const lodash_1 = require("lodash");
|
4
5
|
const extensions_core_1 = require("@awell-health/extensions-core");
|
5
|
-
const client_1 = require("../../client");
|
6
|
-
const config_1 = require("./config");
|
7
|
-
const output_parsers_1 = require("@langchain/core/output_parsers");
|
8
|
-
const zod_1 = require("zod");
|
9
|
-
const openai_1 = require("@langchain/openai");
|
10
6
|
const addEventLog_1 = require("../../../../src/lib/awell/addEventLog");
|
11
|
-
const
|
7
|
+
const config_1 = require("./config");
|
8
|
+
const getFutureAppoitnments_1 = require("./getFutureAppoitnments");
|
9
|
+
const parser_1 = require("./lib/findAppointmentWithLLM/parser");
|
10
|
+
const findAppointmentWithLLM_1 = require("./lib/findAppointmentWithLLM/findAppointmentWithLLM");
|
11
|
+
const createOpenAIModel_1 = require("../../../../src/lib/llm/openai/createOpenAIModel");
|
12
|
+
const constants_1 = require("../../../../src/lib/llm/openai/constants");
|
12
13
|
exports.findFutureAppointment = {
|
13
14
|
key: 'findFutureAppointment',
|
14
15
|
category: extensions_core_1.Category.EHR_INTEGRATIONS,
|
15
|
-
title: '🪄 Find future appointment',
|
16
|
+
title: '🪄 Find future appointment (Beta)',
|
16
17
|
description: 'Find a future appointment in Elation.',
|
17
18
|
fields: config_1.fields,
|
18
19
|
previewable: false,
|
19
20
|
dataPoints: config_1.dataPoints,
|
20
|
-
onEvent: async ({ payload, onComplete, onError }) => {
|
21
|
+
onEvent: async ({ payload, onComplete, onError, helpers }) => {
|
22
|
+
// 1. Validate input
|
21
23
|
const { prompt, patientId } = config_1.FieldsValidationSchema.parse(payload.fields);
|
22
|
-
|
23
|
-
const
|
24
|
-
if (
|
25
|
-
await onError({
|
26
|
-
events: [
|
27
|
-
{
|
28
|
-
date: new Date().toISOString(),
|
29
|
-
text: { en: 'OpenAI API key is required for this action.' },
|
30
|
-
error: {
|
31
|
-
category: 'SERVER_ERROR',
|
32
|
-
message: 'OpenAI API key is required for this action.',
|
33
|
-
},
|
34
|
-
},
|
35
|
-
],
|
36
|
-
});
|
37
|
-
return;
|
38
|
-
}
|
39
|
-
const appointments = await api.findAppointments({
|
40
|
-
patient: patientId,
|
41
|
-
from_date: new Date().toISOString(),
|
42
|
-
});
|
43
|
-
const scheduledOrConfirmedAppointments = appointments.filter((appointment) => appointment.status.status === 'Scheduled' ||
|
44
|
-
appointment.status.status === 'Confirmed');
|
45
|
-
if (scheduledOrConfirmedAppointments.length === 0) {
|
24
|
+
// 2. Get future appointments
|
25
|
+
const appointments = await (0, getFutureAppoitnments_1.getFutureAppointments)(payload.settings, patientId);
|
26
|
+
if (appointments.length === 0) {
|
46
27
|
await onComplete({
|
47
28
|
data_points: {
|
48
29
|
appointmentExists: 'false',
|
@@ -50,74 +31,35 @@ exports.findFutureAppointment = {
|
|
50
31
|
});
|
51
32
|
return;
|
52
33
|
}
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
scheduled_date: appointment.scheduled_date,
|
60
|
-
};
|
61
|
-
return JSON.stringify(relevantInfo);
|
62
|
-
})
|
63
|
-
.join('\n\n');
|
64
|
-
const ChatModelGPT4o = new openai_1.ChatOpenAI({
|
65
|
-
modelName: 'gpt-4o-2024-08-06',
|
66
|
-
openAIApiKey: openAiApiKey,
|
67
|
-
temperature: 0,
|
68
|
-
maxRetries: 3,
|
69
|
-
timeout: 10000,
|
34
|
+
// 3. Initialize OpenAI model with metadata and callbacks
|
35
|
+
const { model, metadata, callbacks } = await (0, createOpenAIModel_1.createOpenAIModel)({
|
36
|
+
settings: payload.settings,
|
37
|
+
helpers,
|
38
|
+
payload,
|
39
|
+
modelType: constants_1.OPENAI_MODELS.GPT4o
|
70
40
|
});
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
Instruction:
|
83
|
-
${prompt}
|
84
|
-
----------
|
85
|
-
|
86
|
-
Output a JSON object with two keys:
|
87
|
-
1. appointmentId: The id of the appointment that matches the instructions, if one exists. If no appointment exists that obviously matches, you should return null.
|
88
|
-
2. explanation: A readable explanation of how the appointment was found and why. Or, if no appointment exists that matches the instructions, an explanation of why.`;
|
89
|
-
const AppointmentIdSchema = zod_1.z.coerce
|
90
|
-
.number()
|
91
|
-
.nullable()
|
92
|
-
.describe('A single appointment');
|
93
|
-
const parser = output_parsers_1.StructuredOutputParser.fromZodSchema(zod_1.z.object({
|
94
|
-
appointmentId: AppointmentIdSchema,
|
95
|
-
explanation: zod_1.z
|
96
|
-
.string()
|
97
|
-
.describe('A readable explanation of how the appointment was found and why'),
|
98
|
-
}));
|
99
|
-
let result;
|
100
|
-
try {
|
101
|
-
const chain = ChatModelGPT4o.pipe(parser);
|
102
|
-
result = await chain.invoke(systemPrompt);
|
103
|
-
}
|
104
|
-
catch (invokeError) {
|
105
|
-
console.error('Error invoking ChatModelGPT4o for findFutureAppointment:', invokeError);
|
106
|
-
throw new Error('Failed to find future appointment.');
|
107
|
-
}
|
108
|
-
const matchedAppointmentId = AppointmentIdSchema.parse(result.appointmentId);
|
109
|
-
const foundAppointment = scheduledOrConfirmedAppointments.find((appointment) => appointment.id === Number(matchedAppointmentId));
|
41
|
+
// 4. Find matching appointment
|
42
|
+
const { appointmentId, explanation } = await (0, findAppointmentWithLLM_1.findAppointmentWithLLM)({
|
43
|
+
model,
|
44
|
+
appointments,
|
45
|
+
prompt,
|
46
|
+
metadata,
|
47
|
+
callbacks
|
48
|
+
});
|
49
|
+
const matchedAppointmentId = parser_1.AppointmentIdSchema.parse(appointmentId);
|
50
|
+
const foundAppointment = appointments.find((appointment) => appointment.id === Number(matchedAppointmentId));
|
51
|
+
// 5. Complete action with results
|
110
52
|
await onComplete({
|
111
53
|
data_points: {
|
112
54
|
appointment: !(0, lodash_1.isNil)(matchedAppointmentId)
|
113
55
|
? JSON.stringify(foundAppointment)
|
114
56
|
: undefined,
|
115
|
-
explanation
|
57
|
+
explanation,
|
116
58
|
appointmentExists: !(0, lodash_1.isNil)(matchedAppointmentId) ? 'true' : 'false',
|
117
59
|
},
|
118
60
|
events: [
|
119
61
|
(0, addEventLog_1.addActivityEventLog)({
|
120
|
-
message: `Number of future scheduled or confirmed appointments for patient ${patientId}: ${
|
62
|
+
message: `Number of future scheduled or confirmed appointments for patient ${patientId}: ${appointments.length}\nFound appointment: ${(0, lodash_1.isNil)(foundAppointment) ? 'none' : foundAppointment === null || foundAppointment === void 0 ? void 0 : foundAppointment.id}\nExplanation: ${explanation}`,
|
121
63
|
}),
|
122
64
|
],
|
123
65
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"findFutureAppointment.js","sourceRoot":"","sources":["../../../../../extensions/elation/actions/findFutureAppointment/findFutureAppointment.ts"],"names":[],"mappings":";;;AAAA,mEAAqE;AAErE,
|
1
|
+
{"version":3,"file":"findFutureAppointment.js","sourceRoot":"","sources":["../../../../../extensions/elation/actions/findFutureAppointment/findFutureAppointment.ts"],"names":[],"mappings":";;;AAAA,mCAA8B;AAC9B,mEAAqE;AAErE,uEAA2E;AAE3E,qCAAqE;AACrE,mEAA+D;AAC/D,gEAAyE;AACzE,gGAA4F;AAC5F,wFAAoF;AACpF,wEAAwE;AAE3D,QAAA,qBAAqB,GAI9B;IACF,GAAG,EAAE,uBAAuB;IAC5B,QAAQ,EAAE,0BAAQ,CAAC,gBAAgB;IACnC,KAAK,EAAE,mCAAmC;IAC1C,WAAW,EAAE,uCAAuC;IACpD,MAAM,EAAN,eAAM;IACN,WAAW,EAAE,KAAK;IAClB,UAAU,EAAV,mBAAU;IACV,OAAO,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,EAAiB,EAAE;QAC1E,oBAAoB;QACpB,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,+BAAsB,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;QAE1E,6BAA6B;QAC7B,MAAM,YAAY,GAAG,MAAM,IAAA,6CAAqB,EAC9C,OAAO,CAAC,QAAwB,EAChC,SAAS,CACV,CAAA;QAED,IAAI,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC9B,MAAM,UAAU,CAAC;gBACf,WAAW,EAAE;oBACX,iBAAiB,EAAE,OAAO;iBAC3B;aACF,CAAC,CAAA;YACF,OAAM;QACR,CAAC;QAED,yDAAyD;QACzD,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,MAAM,IAAA,qCAAiB,EAAC;YAC7D,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,OAAO;YACP,OAAO;YACP,SAAS,EAAE,yBAAa,CAAC,KAAK;SAC/B,CAAC,CAAA;QAEF,+BAA+B;QAC/B,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE,GAAG,MAAM,IAAA,+CAAsB,EAAC;YAClE,KAAK;YACL,YAAY;YACZ,MAAM;YACN,QAAQ;YACR,SAAS;SACV,CAAC,CAAA;QAEF,MAAM,oBAAoB,GAAG,4BAAmB,CAAC,KAAK,CAAC,aAAa,CAAC,CAAA;QACrE,MAAM,gBAAgB,GAAG,YAAY,CAAC,IAAI,CACxC,CAAC,WAAW,EAAE,EAAE,CAAC,WAAW,CAAC,EAAE,KAAK,MAAM,CAAC,oBAAoB,CAAC,CACjE,CAAA;QAED,kCAAkC;QAClC,MAAM,UAAU,CAAC;YACf,WAAW,EAAE;gBACX,WAAW,EAAE,CAAC,IAAA,cAAK,EAAC,oBAAoB,CAAC;oBACvC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC;oBAClC,CAAC,CAAC,SAAS;gBACb,WAAW;gBACX,iBAAiB,EAAE,CAAC,IAAA,cAAK,EAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO;aACnE;YACD,MAAM,EAAE;gBACN,IAAA,iCAAmB,EAAC;oBAClB,OAAO,EAAE,oEAAoE,SAAS,KAAK,YAAY,CAAC,MAAM,wBAAwB,IAAA,cAAK,EAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,EAAE,kBAAkB,WAAW,EAAE;iBAC7N,CAAC;aACH;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA"}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.formatAppointments = void 0;
|
4
|
+
const formatAppointments = (appointments) => {
|
5
|
+
return appointments
|
6
|
+
.map((appointment) => {
|
7
|
+
const relevantInfo = {
|
8
|
+
id: appointment.id,
|
9
|
+
reason: appointment.reason,
|
10
|
+
duration: appointment.duration,
|
11
|
+
scheduled_date: appointment.scheduled_date,
|
12
|
+
};
|
13
|
+
return JSON.stringify(relevantInfo);
|
14
|
+
})
|
15
|
+
.join('\n\n');
|
16
|
+
};
|
17
|
+
exports.formatAppointments = formatAppointments;
|
18
|
+
//# sourceMappingURL=formatAppointments.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"formatAppointments.js","sourceRoot":"","sources":["../../../../../extensions/elation/actions/findFutureAppointment/formatAppointments.ts"],"names":[],"mappings":";;;AAEO,MAAM,kBAAkB,GAAG,CAAC,YAAmC,EAAU,EAAE;IAC9E,OAAO,YAAY;SAChB,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE;QACnB,MAAM,YAAY,GAAG;YACnB,EAAE,EAAE,WAAW,CAAC,EAAE;YAClB,MAAM,EAAE,WAAW,CAAC,MAAM;YAC1B,QAAQ,EAAE,WAAW,CAAC,QAAQ;YAC9B,cAAc,EAAE,WAAW,CAAC,cAAc;SAC3C,CAAA;QACD,OAAO,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,CAAA;IACrC,CAAC,CAAC;SACD,IAAI,CAAC,MAAM,CAAC,CAAA;AACjB,CAAC,CAAA;AAZU,QAAA,kBAAkB,sBAY5B"}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.getFutureAppointments = void 0;
|
4
|
+
const client_1 = require("../../client");
|
5
|
+
const getFutureAppointments = async (elationSettings, patientId) => {
|
6
|
+
const api = (0, client_1.makeAPIClient)(elationSettings);
|
7
|
+
const appointments = await api.findAppointments({
|
8
|
+
patient: patientId,
|
9
|
+
from_date: new Date().toISOString(),
|
10
|
+
});
|
11
|
+
return appointments.filter((appointment) => appointment.status.status === 'Scheduled' ||
|
12
|
+
appointment.status.status === 'Confirmed');
|
13
|
+
};
|
14
|
+
exports.getFutureAppointments = getFutureAppointments;
|
15
|
+
//# sourceMappingURL=getFutureAppoitnments.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"getFutureAppoitnments.js","sourceRoot":"","sources":["../../../../../extensions/elation/actions/findFutureAppointment/getFutureAppoitnments.ts"],"names":[],"mappings":";;;AAEA,yCAA4C;AAKrC,MAAM,qBAAqB,GAAG,KAAK,EAAE,eAA6B,EAAE,SAAiB,EAAkC,EAAE;IAC9H,MAAM,GAAG,GAAG,IAAA,sBAAa,EAAC,eAAe,CAAC,CAAA;IAE1C,MAAM,YAAY,GAAG,MAAM,GAAG,CAAC,gBAAgB,CAAC;QAC9C,OAAO,EAAE,SAAS;QAClB,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;KACpC,CAAC,CAAA;IACF,OAAO,YAAY,CAAC,MAAM,CACxB,CAAC,WAAW,EAAE,EAAE,CACd,WAAW,CAAC,MAAM,CAAC,MAAM,KAAK,WAAW;QACzC,WAAW,CAAC,MAAM,CAAC,MAAM,KAAK,WAAW,CAC5C,CAAA;AACH,CAAC,CAAA;AAZY,QAAA,qBAAqB,yBAYjC"}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { type ChatOpenAI } from '@langchain/openai';
|
2
|
+
import { type AIActionMetadata } from '../../../../../../src/lib/llm/openai/types';
|
3
|
+
import type { BaseCallbackHandler } from "@langchain/core/callbacks/base";
|
4
|
+
import { type AppointmentFromAI } from './parser';
|
5
|
+
import { type AppointmentResponse } from '../../../../types';
|
6
|
+
interface FindAppointmentWithLLMProps {
|
7
|
+
model: ChatOpenAI;
|
8
|
+
appointments: AppointmentResponse[];
|
9
|
+
prompt: string;
|
10
|
+
metadata: AIActionMetadata;
|
11
|
+
callbacks?: BaseCallbackHandler[];
|
12
|
+
}
|
13
|
+
export declare const findAppointmentWithLLM: ({ model, appointments, prompt, metadata, callbacks, }: FindAppointmentWithLLMProps) => Promise<AppointmentFromAI>;
|
14
|
+
export {};
|
@@ -0,0 +1,29 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.findAppointmentWithLLM = void 0;
|
4
|
+
const prompt_1 = require("./prompt");
|
5
|
+
const parser_1 = require("./parser");
|
6
|
+
const formatAppointments_1 = require("../../formatAppointments");
|
7
|
+
const findAppointmentWithLLM = async ({ model, appointments, prompt, metadata, callbacks, }) => {
|
8
|
+
const chain = model.pipe(parser_1.parser);
|
9
|
+
try {
|
10
|
+
const result = await chain.invoke(await prompt_1.systemPrompt.format({
|
11
|
+
format_instructions: parser_1.parser.getFormatInstructions(),
|
12
|
+
appointments: (0, formatAppointments_1.formatAppointments)(appointments),
|
13
|
+
prompt,
|
14
|
+
}), {
|
15
|
+
metadata,
|
16
|
+
runName: 'ElationFindAppointment',
|
17
|
+
callbacks
|
18
|
+
});
|
19
|
+
return {
|
20
|
+
appointmentId: result.appointmentId,
|
21
|
+
explanation: result.explanation
|
22
|
+
};
|
23
|
+
}
|
24
|
+
catch (error) {
|
25
|
+
throw new Error('Failed to find matching appointment.');
|
26
|
+
}
|
27
|
+
};
|
28
|
+
exports.findAppointmentWithLLM = findAppointmentWithLLM;
|
29
|
+
//# sourceMappingURL=findAppointmentWithLLM.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"findAppointmentWithLLM.js","sourceRoot":"","sources":["../../../../../../../extensions/elation/actions/findFutureAppointment/lib/findAppointmentWithLLM/findAppointmentWithLLM.ts"],"names":[],"mappings":";;;AAGA,qCAAuC;AACvC,qCAAyD;AAEzD,iEAA6D;AAUtD,MAAM,sBAAsB,GAAG,KAAK,EAAE,EAC3C,KAAK,EACL,YAAY,EACZ,MAAM,EACN,QAAQ,EACR,SAAS,GACmB,EAA8B,EAAE;IAC5D,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,eAAM,CAAC,CAAA;IAEhC,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,MAAM,CAC/B,MAAM,qBAAY,CAAC,MAAM,CAAC;YACxB,mBAAmB,EAAE,eAAM,CAAC,qBAAqB,EAAE;YACnD,YAAY,EAAE,IAAA,uCAAkB,EAAC,YAAY,CAAC;YAC9C,MAAM;SACP,CAAC,EACF;YACE,QAAQ;YACR,OAAO,EAAE,wBAAwB;YACjC,SAAS;SACV,CACF,CAAA;QAED,OAAO;YACL,aAAa,EAAE,MAAM,CAAC,aAAa;YACnC,WAAW,EAAE,MAAM,CAAC,WAAW;SAChC,CAAA;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAA;IACzD,CAAC;AACH,CAAC,CAAA;AA9BY,QAAA,sBAAsB,0BA8BlC"}
|
package/dist/extensions/elation/actions/findFutureAppointment/lib/findAppointmentWithLLM/parser.d.ts
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
import { z } from 'zod';
|
2
|
+
import { StructuredOutputParser } from '@langchain/core/output_parsers';
|
3
|
+
export declare const AppointmentIdSchema: z.ZodNullable<z.ZodNumber>;
|
4
|
+
export declare const parser: StructuredOutputParser<z.ZodObject<{
|
5
|
+
appointmentId: z.ZodNullable<z.ZodNumber>;
|
6
|
+
explanation: z.ZodString;
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
8
|
+
appointmentId: number | null;
|
9
|
+
explanation: string;
|
10
|
+
}, {
|
11
|
+
appointmentId: number | null;
|
12
|
+
explanation: string;
|
13
|
+
}>>;
|
14
|
+
export interface AppointmentFromAI {
|
15
|
+
appointmentId: number | null;
|
16
|
+
explanation: string;
|
17
|
+
}
|
package/dist/extensions/elation/actions/findFutureAppointment/lib/findAppointmentWithLLM/parser.js
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.parser = exports.AppointmentIdSchema = void 0;
|
4
|
+
const zod_1 = require("zod");
|
5
|
+
const output_parsers_1 = require("@langchain/core/output_parsers");
|
6
|
+
exports.AppointmentIdSchema = zod_1.z.coerce
|
7
|
+
.number()
|
8
|
+
.nullable()
|
9
|
+
.describe('A single appointment');
|
10
|
+
exports.parser = output_parsers_1.StructuredOutputParser.fromZodSchema(zod_1.z.object({
|
11
|
+
appointmentId: exports.AppointmentIdSchema,
|
12
|
+
explanation: zod_1.z
|
13
|
+
.string()
|
14
|
+
.describe('A readable explanation of how the appointment was found and why'),
|
15
|
+
}));
|
16
|
+
//# sourceMappingURL=parser.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"parser.js","sourceRoot":"","sources":["../../../../../../../extensions/elation/actions/findFutureAppointment/lib/findAppointmentWithLLM/parser.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AACvB,mEAAuE;AAE1D,QAAA,mBAAmB,GAAG,OAAC,CAAC,MAAM;KACxC,MAAM,EAAE;KACR,QAAQ,EAAE;KACV,QAAQ,CAAC,sBAAsB,CAAC,CAAA;AAEtB,QAAA,MAAM,GAAG,uCAAsB,CAAC,aAAa,CACxD,OAAC,CAAC,MAAM,CAAC;IACP,aAAa,EAAE,2BAAmB;IAClC,WAAW,EAAE,OAAC;SACX,MAAM,EAAE;SACR,QAAQ,CACP,iEAAiE,CAClE;CACJ,CAAC,CACH,CAAA"}
|
package/dist/extensions/elation/actions/findFutureAppointment/lib/findAppointmentWithLLM/prompt.d.ts
ADDED
@@ -0,0 +1,2 @@
|
|
1
|
+
import { ChatPromptTemplate } from '@langchain/core/prompts';
|
2
|
+
export declare const systemPrompt: ChatPromptTemplate<import("@langchain/core/prompts").ParamsFromFString<"\n You are a helpful medical assistant. You will receive a list (array) of future appointments for a single patient and instructions about which appointment to find. You're supposed to use the information in the list to find an appointment that matches, if one exists.\n \n Important instructions:\n - The appointment \"reason\" is the appointment type.\n - Pay close attention to the instructions. They are intended to have been written by a clinician, for a clinician.\n - Think like a clinician. In other words, \"Rx\" should match a prescription appointment or follow-up related to a prescription.\n - If no appointment exists that obviously matches the instructions, that's a perfectly acceptable outcome.\n - If multiple appointments exist that match the instructions, you should return the first one.\n - Return your response in the following JSON format:\n {format_instructions}\n\n Input array: {appointments}\n Instruction: {prompt}\n">, any>;
|
package/dist/extensions/elation/actions/findFutureAppointment/lib/findAppointmentWithLLM/prompt.js
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.systemPrompt = void 0;
|
4
|
+
const prompts_1 = require("@langchain/core/prompts");
|
5
|
+
exports.systemPrompt = prompts_1.ChatPromptTemplate.fromTemplate(`
|
6
|
+
You are a helpful medical assistant. You will receive a list (array) of future appointments for a single patient and instructions about which appointment to find. You're supposed to use the information in the list to find an appointment that matches, if one exists.
|
7
|
+
|
8
|
+
Important instructions:
|
9
|
+
- The appointment "reason" is the appointment type.
|
10
|
+
- Pay close attention to the instructions. They are intended to have been written by a clinician, for a clinician.
|
11
|
+
- Think like a clinician. In other words, "Rx" should match a prescription appointment or follow-up related to a prescription.
|
12
|
+
- If no appointment exists that obviously matches the instructions, that's a perfectly acceptable outcome.
|
13
|
+
- If multiple appointments exist that match the instructions, you should return the first one.
|
14
|
+
- Return your response in the following JSON format:
|
15
|
+
{format_instructions}
|
16
|
+
|
17
|
+
Input array: {appointments}
|
18
|
+
Instruction: {prompt}
|
19
|
+
`);
|
20
|
+
//# sourceMappingURL=prompt.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../../../../../../extensions/elation/actions/findFutureAppointment/lib/findAppointmentWithLLM/prompt.ts"],"names":[],"mappings":";;;AAAA,qDAA4D;AAE/C,QAAA,YAAY,GAAG,4BAAkB,CAAC,YAAY,CAAC;;;;;;;;;;;;;;CAc3D,CAAC,CAAA"}
|