@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,3 +1,37 @@
|
|
1
1
|
import { z } from 'zod';
|
2
|
-
export declare const settings: {
|
3
|
-
|
2
|
+
export declare const settings: {
|
3
|
+
tenantId: {
|
4
|
+
key: string;
|
5
|
+
label: string;
|
6
|
+
required: true;
|
7
|
+
obfuscated: false;
|
8
|
+
description: string;
|
9
|
+
};
|
10
|
+
clientId: {
|
11
|
+
key: string;
|
12
|
+
label: string;
|
13
|
+
required: true;
|
14
|
+
obfuscated: false;
|
15
|
+
description: string;
|
16
|
+
};
|
17
|
+
clientSecret: {
|
18
|
+
key: string;
|
19
|
+
label: string;
|
20
|
+
required: true;
|
21
|
+
obfuscated: true;
|
22
|
+
description: string;
|
23
|
+
};
|
24
|
+
};
|
25
|
+
export declare const SettingsValidationSchema: z.ZodObject<{
|
26
|
+
tenantId: z.ZodString;
|
27
|
+
clientId: z.ZodString;
|
28
|
+
clientSecret: z.ZodString;
|
29
|
+
}, "strip", z.ZodTypeAny, {
|
30
|
+
tenantId: string;
|
31
|
+
clientId: string;
|
32
|
+
clientSecret: string;
|
33
|
+
}, {
|
34
|
+
tenantId: string;
|
35
|
+
clientId: string;
|
36
|
+
clientSecret: string;
|
37
|
+
}>;
|
@@ -2,6 +2,32 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.SettingsValidationSchema = exports.settings = void 0;
|
4
4
|
const zod_1 = require("zod");
|
5
|
-
exports.settings = {
|
6
|
-
|
5
|
+
exports.settings = {
|
6
|
+
tenantId: {
|
7
|
+
key: 'tenantId',
|
8
|
+
label: 'Base URL',
|
9
|
+
required: true,
|
10
|
+
obfuscated: false,
|
11
|
+
description: 'The tenant ID associated to the organization you are connecting to.',
|
12
|
+
},
|
13
|
+
clientId: {
|
14
|
+
key: 'clientId',
|
15
|
+
label: 'Client ID',
|
16
|
+
required: true,
|
17
|
+
obfuscated: false,
|
18
|
+
description: 'The client ID of the Cerner app used to authenticate.',
|
19
|
+
},
|
20
|
+
clientSecret: {
|
21
|
+
key: 'clientSecret',
|
22
|
+
label: 'Client Secret',
|
23
|
+
required: true,
|
24
|
+
obfuscated: true,
|
25
|
+
description: 'The client secret of the Cerner app used to authenticate.',
|
26
|
+
},
|
27
|
+
};
|
28
|
+
exports.SettingsValidationSchema = zod_1.z.object({
|
29
|
+
tenantId: zod_1.z.string().min(1),
|
30
|
+
clientId: zod_1.z.string().min(1),
|
31
|
+
clientSecret: zod_1.z.string().min(1),
|
32
|
+
});
|
7
33
|
//# sourceMappingURL=settings.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../../../extensions/cerner/settings.ts"],"names":[],"mappings":";;;AACA,6BAAwC;AAE3B,QAAA,QAAQ,GAAG,
|
1
|
+
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../../../extensions/cerner/settings.ts"],"names":[],"mappings":";;;AACA,6BAAwC;AAE3B,QAAA,QAAQ,GAAG;IACtB,QAAQ,EAAE;QACR,GAAG,EAAE,UAAU;QACf,KAAK,EAAE,UAAU;QACjB,QAAQ,EAAE,IAAI;QACd,UAAU,EAAE,KAAK;QACjB,WAAW,EACT,qEAAqE;KACxE;IACD,QAAQ,EAAE;QACR,GAAG,EAAE,UAAU;QACf,KAAK,EAAE,WAAW;QAClB,QAAQ,EAAE,IAAI;QACd,UAAU,EAAE,KAAK;QACjB,WAAW,EAAE,uDAAuD;KACrE;IACD,YAAY,EAAE;QACZ,GAAG,EAAE,cAAc;QACnB,KAAK,EAAE,eAAe;QACtB,QAAQ,EAAE,IAAI;QACd,UAAU,EAAE,IAAI;QAChB,WAAW,EAAE,2DAA2D;KACzE;CACgC,CAAA;AAEtB,QAAA,wBAAwB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC/C,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3B,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3B,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CACoB,CAAC,CAAA"}
|
@@ -13,16 +13,16 @@ export declare const DockSettingsSchema: z.ZodObject<{
|
|
13
13
|
userId: z.ZodString;
|
14
14
|
}, "strip", z.ZodTypeAny, {
|
15
15
|
apiKey: string;
|
16
|
-
environment: "DEVELOPMENT" | "PRODUCTION";
|
17
16
|
clientId: string;
|
18
17
|
clientSecret: string;
|
18
|
+
environment: "DEVELOPMENT" | "PRODUCTION";
|
19
19
|
organizationId: string;
|
20
20
|
userId: string;
|
21
21
|
}, {
|
22
22
|
apiKey: string;
|
23
|
-
environment: string;
|
24
23
|
clientId: string;
|
25
24
|
clientSecret: string;
|
25
|
+
environment: string;
|
26
26
|
organizationId: string;
|
27
27
|
userId: string;
|
28
28
|
}>;
|
package/dist/extensions/elation/actions/findAppointmentsByPrompt/findAppointmentsByPrompt.js
CHANGED
@@ -1,42 +1,25 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.findAppointmentsByPrompt = void 0;
|
4
|
+
const lodash_1 = require("lodash");
|
4
5
|
const extensions_core_1 = require("@awell-health/extensions-core");
|
6
|
+
const addEventLog_1 = require("../../../../src/lib/awell/addEventLog");
|
5
7
|
const client_1 = require("../../client");
|
8
|
+
const createOpenAIModel_1 = require("../../../../src/lib/llm/openai/createOpenAIModel");
|
6
9
|
const config_1 = require("./config");
|
7
|
-
const
|
8
|
-
const
|
9
|
-
const openai_1 = require("@langchain/openai");
|
10
|
-
const addEventLog_1 = require("../../../../src/lib/awell/addEventLog");
|
11
|
-
const appointment_zod_1 = require("../../validation/appointment.zod");
|
12
|
-
const lodash_1 = require("lodash");
|
10
|
+
const getAppoitnmentCountByStatus_1 = require("./getAppoitnmentCountByStatus");
|
11
|
+
const findAppointmentsByPromptWithLLM_1 = require("./lib/findAppointmentsByPromptWithLLM/findAppointmentsByPromptWithLLM");
|
13
12
|
exports.findAppointmentsByPrompt = {
|
14
13
|
key: 'findAppointmentsByPrompt',
|
15
14
|
category: extensions_core_1.Category.EHR_INTEGRATIONS,
|
16
|
-
title: '🪄 Find Appointments by Prompt',
|
15
|
+
title: '🪄 Find Appointments by Prompt (Beta)',
|
17
16
|
description: 'Find all appointments for a patient using natural language.',
|
18
17
|
fields: config_1.fields,
|
19
18
|
previewable: false,
|
20
19
|
dataPoints: config_1.dataPoints,
|
21
|
-
onEvent: async ({ payload, onComplete, onError }) => {
|
20
|
+
onEvent: async ({ payload, onComplete, onError, helpers }) => {
|
22
21
|
const { prompt, patientId } = config_1.FieldsValidationSchema.parse(payload.fields);
|
23
22
|
const api = (0, client_1.makeAPIClient)(payload.settings);
|
24
|
-
const openAiApiKey = payload.settings.openAiApiKey;
|
25
|
-
if (openAiApiKey === undefined || openAiApiKey === '') {
|
26
|
-
await onError({
|
27
|
-
events: [
|
28
|
-
{
|
29
|
-
date: new Date().toISOString(),
|
30
|
-
text: { en: 'OpenAI API key is required for this action.' },
|
31
|
-
error: {
|
32
|
-
category: 'SERVER_ERROR',
|
33
|
-
message: 'OpenAI API key is required for this action.',
|
34
|
-
},
|
35
|
-
},
|
36
|
-
],
|
37
|
-
});
|
38
|
-
return;
|
39
|
-
}
|
40
23
|
const appointments = await api.findAppointments({
|
41
24
|
patient: patientId,
|
42
25
|
});
|
@@ -44,117 +27,54 @@ exports.findAppointmentsByPrompt = {
|
|
44
27
|
await onComplete({
|
45
28
|
data_points: {
|
46
29
|
explanation: 'No appointments found',
|
47
|
-
appointments: JSON.stringify(
|
30
|
+
appointments: JSON.stringify([]),
|
48
31
|
appointmentCountsByStatus: JSON.stringify({}),
|
49
32
|
},
|
50
33
|
});
|
51
34
|
return;
|
52
35
|
}
|
53
|
-
const promptAppointments = appointments
|
54
|
-
.map((appointment) => {
|
55
|
-
const relevantInfo = {
|
56
|
-
id: appointment.id,
|
57
|
-
reason: appointment.reason,
|
58
|
-
scheduled_date: appointment.scheduled_date,
|
59
|
-
};
|
60
|
-
return JSON.stringify(relevantInfo);
|
61
|
-
})
|
62
|
-
.join('\n\n');
|
63
|
-
const ChatModelGPT4o = new openai_1.ChatOpenAI({
|
64
|
-
modelName: 'gpt-4o',
|
65
|
-
openAIApiKey: openAiApiKey,
|
66
|
-
temperature: 0,
|
67
|
-
maxRetries: 3,
|
68
|
-
timeout: 10000,
|
69
|
-
});
|
70
|
-
const systemPrompt = createSystemPrompt({
|
71
|
-
prompt,
|
72
|
-
appointments: promptAppointments,
|
73
|
-
});
|
74
|
-
const AppointmentIdSchema = zod_1.z.array(zod_1.z.string());
|
75
|
-
const parser = output_parsers_1.StructuredOutputParser.fromZodSchema(zod_1.z.object({
|
76
|
-
appointmentIds: AppointmentIdSchema,
|
77
|
-
explanation: zod_1.z
|
78
|
-
.string()
|
79
|
-
.describe('A readable explanation of how the appointments were found and why'),
|
80
|
-
}));
|
81
|
-
let result;
|
82
36
|
try {
|
83
|
-
const
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
37
|
+
const { model, metadata, callbacks } = await (0, createOpenAIModel_1.createOpenAIModel)({
|
38
|
+
settings: payload.settings,
|
39
|
+
helpers,
|
40
|
+
payload,
|
41
|
+
});
|
42
|
+
const { appointmentIds, explanation } = await (0, findAppointmentsByPromptWithLLM_1.findAppointmentsByPromptWithLLM)({
|
43
|
+
model,
|
44
|
+
appointments,
|
45
|
+
prompt,
|
46
|
+
metadata,
|
47
|
+
callbacks
|
48
|
+
});
|
49
|
+
const selectedAppointments = appointments.filter((appointment) => appointmentIds.includes(appointment.id));
|
50
|
+
const appointmentCountsByStatus = (0, getAppoitnmentCountByStatus_1.getAppointmentCountsByStatus)(selectedAppointments);
|
93
51
|
await onComplete({
|
94
52
|
data_points: {
|
95
|
-
|
53
|
+
appointments: JSON.stringify(selectedAppointments),
|
54
|
+
explanation,
|
55
|
+
appointmentCountsByStatus: JSON.stringify(appointmentCountsByStatus),
|
96
56
|
},
|
57
|
+
events: [
|
58
|
+
(0, addEventLog_1.addActivityEventLog)({
|
59
|
+
message: `Found ${selectedAppointments.length} appointments for patient ${patientId}`
|
60
|
+
}),
|
61
|
+
],
|
97
62
|
});
|
98
|
-
return;
|
99
63
|
}
|
100
|
-
|
101
|
-
console.log('Some appointments were not found');
|
102
|
-
const errorMessage = `Some appointments were not found. Found ${selectedAppointments.length} appointments, but the prompt resulted in ${result.appointmentIds.length} appointments.`;
|
64
|
+
catch (error) {
|
103
65
|
await onError({
|
104
66
|
events: [
|
105
67
|
{
|
106
68
|
date: new Date().toISOString(),
|
107
|
-
text: { en:
|
69
|
+
text: { en: 'Failed to find appointments' },
|
108
70
|
error: {
|
109
71
|
category: 'SERVER_ERROR',
|
110
|
-
message:
|
72
|
+
message: error instanceof Error ? error.message : 'Unknown error',
|
111
73
|
},
|
112
74
|
},
|
113
75
|
],
|
114
76
|
});
|
115
|
-
return;
|
116
77
|
}
|
117
|
-
const appointmentCountsByStatus = Object.values(appointment_zod_1.statusEnum.Values).reduce((acc, status) => {
|
118
|
-
const cnt = selectedAppointments.filter((appointment) => (appointment === null || appointment === void 0 ? void 0 : appointment.status.status) === status).length;
|
119
|
-
if (cnt > 0) {
|
120
|
-
acc[status] = cnt;
|
121
|
-
}
|
122
|
-
return acc;
|
123
|
-
}, {});
|
124
|
-
await onComplete({
|
125
|
-
data_points: {
|
126
|
-
appointments: JSON.stringify(selectedAppointments),
|
127
|
-
explanation: result.explanation,
|
128
|
-
appointmentCountsByStatus: JSON.stringify(appointmentCountsByStatus),
|
129
|
-
},
|
130
|
-
events: [
|
131
|
-
(0, addEventLog_1.addActivityEventLog)({
|
132
|
-
message: `Found ${selectedAppointments.length} appointments for patient ${patientId}\nExplanation: ${result.explanation}\nAppointment counts by status: ${JSON.stringify(appointmentCountsByStatus)}`,
|
133
|
-
}),
|
134
|
-
],
|
135
|
-
});
|
136
78
|
},
|
137
79
|
};
|
138
|
-
const createSystemPrompt = ({ prompt, appointments, }) => {
|
139
|
-
const currentDate = new Date().getDate();
|
140
|
-
return `You are a helpful medical assistant. You will receive a list (array) of appointments for a single patient and instructions about which types of appointments to find. You're supposed to use the information in the list to find appointments that match, if any exist. If no appointments exists that obviously match the instructions, that's a perfectly acceptable outcome. If multiple appointments exist that match the instructions, you should return all of them.
|
141
|
-
|
142
|
-
Important instructions:
|
143
|
-
- The appointment "reason" is the appointment type.
|
144
|
-
- Only include appointment ids that exist in the input array. If no appointments exist that match the instructions, return an empty array.
|
145
|
-
- Pay close attention to the instructions. They are intended to have been written by a clinician, for a clinician.
|
146
|
-
- Think like a clinician. In other words, "Rx" should match a prescription appointment or follow-up related to a prescription, and "PT" would matchphysical therapy.
|
147
|
-
- The current date is ${currentDate}.
|
148
|
-
----------
|
149
|
-
Input array:
|
150
|
-
${appointments}
|
151
|
-
----------
|
152
|
-
Instruction:
|
153
|
-
${prompt}
|
154
|
-
----------
|
155
|
-
|
156
|
-
Output a JSON object with the following keys:
|
157
|
-
1. appointmentIds: array of strings where each string is an appointment_id that matches the instructions (or an empty array if no appointments exist that match the instructions).
|
158
|
-
2. explanation: A readable explanation of how the appointments were found and why. Or, if no appointments exist that match the instructions, an explanation of why.`;
|
159
|
-
};
|
160
80
|
//# sourceMappingURL=findAppointmentsByPrompt.js.map
|
package/dist/extensions/elation/actions/findAppointmentsByPrompt/findAppointmentsByPrompt.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"findAppointmentsByPrompt.js","sourceRoot":"","sources":["../../../../../extensions/elation/actions/findAppointmentsByPrompt/findAppointmentsByPrompt.ts"],"names":[],"mappings":";;;AAAA,
|
1
|
+
{"version":3,"file":"findAppointmentsByPrompt.js","sourceRoot":"","sources":["../../../../../extensions/elation/actions/findAppointmentsByPrompt/findAppointmentsByPrompt.ts"],"names":[],"mappings":";;;AAAA,mCAA8B;AAC9B,mEAAqE;AACrE,uEAA2E;AAE3E,yCAA4C;AAC5C,wFAAoF;AACpF,qCAAqE;AACrE,+EAA4E;AAC5E,2HAAuH;AAE1G,QAAA,wBAAwB,GAIjC;IACF,GAAG,EAAE,0BAA0B;IAC/B,QAAQ,EAAE,0BAAQ,CAAC,gBAAgB;IACnC,KAAK,EAAE,uCAAuC;IAC9C,WAAW,EAAE,6DAA6D;IAC1E,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,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,+BAAsB,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;QAC1E,MAAM,GAAG,GAAG,IAAA,sBAAa,EAAC,OAAO,CAAC,QAAQ,CAAC,CAAA;QAE3C,MAAM,YAAY,GAAG,MAAM,GAAG,CAAC,gBAAgB,CAAC;YAC9C,OAAO,EAAE,SAAS;SACnB,CAAC,CAAA;QAEF,IAAI,IAAA,cAAK,EAAC,YAAY,CAAC,IAAI,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACrD,MAAM,UAAU,CAAC;gBACf,WAAW,EAAE;oBACX,WAAW,EAAE,uBAAuB;oBACpC,YAAY,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;oBAChC,yBAAyB,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;iBAC9C;aACF,CAAC,CAAA;YACF,OAAM;QACR,CAAC;QAED,IAAI,CAAC;YACH,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,MAAM,IAAA,qCAAiB,EAAC;gBAC7D,QAAQ,EAAE,OAAO,CAAC,QAAQ;gBAC1B,OAAO;gBACP,OAAO;aACR,CAAC,CAAA;YAEF,MAAM,EAAE,cAAc,EAAE,WAAW,EAAE,GAAG,MAAM,IAAA,iEAA+B,EAAC;gBAC5E,KAAK;gBACL,YAAY;gBACZ,MAAM;gBACN,QAAQ;gBACR,SAAS;aACV,CAAC,CAAA;YAEF,MAAM,oBAAoB,GAAG,YAAY,CAAC,MAAM,CAC9C,CAAC,WAAW,EAAE,EAAE,CAAC,cAAc,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,CACzD,CAAA;YAED,MAAM,yBAAyB,GAAG,IAAA,0DAA4B,EAAC,oBAAoB,CAAC,CAAA;YAEpF,MAAM,UAAU,CAAC;gBACf,WAAW,EAAE;oBACX,YAAY,EAAE,IAAI,CAAC,SAAS,CAAC,oBAAoB,CAAC;oBAClD,WAAW;oBACX,yBAAyB,EAAE,IAAI,CAAC,SAAS,CAAC,yBAAyB,CAAC;iBACrE;gBACD,MAAM,EAAE;oBACN,IAAA,iCAAmB,EAAC;wBAClB,OAAO,EAAE,SAAS,oBAAoB,CAAC,MAAM,6BAA6B,SAAS,EAAE;qBACtF,CAAC;iBACH;aACF,CAAC,CAAA;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,OAAO,CAAC;gBACZ,MAAM,EAAE;oBACN;wBACE,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;wBAC9B,IAAI,EAAE,EAAE,EAAE,EAAE,6BAA6B,EAAE;wBAC3C,KAAK,EAAE;4BACL,QAAQ,EAAE,cAAc;4BACxB,OAAO,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe;yBAClE;qBACF;iBACF;aACF,CAAC,CAAA;QACJ,CAAC;IACH,CAAC;CACF,CAAA"}
|
package/dist/extensions/elation/actions/findAppointmentsByPrompt/getAppoitnmentCountByStatus.js
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.getAppointmentCountsByStatus = void 0;
|
4
|
+
const appointment_zod_1 = require("../../validation/appointment.zod");
|
5
|
+
const getAppointmentCountsByStatus = (appointments) => {
|
6
|
+
return Object.values(appointment_zod_1.statusEnum.Values).reduce((acc, status) => {
|
7
|
+
const cnt = appointments.filter((appointment) => (appointment === null || appointment === void 0 ? void 0 : appointment.status.status) === status).length;
|
8
|
+
if (cnt > 0) {
|
9
|
+
acc[status] = cnt;
|
10
|
+
}
|
11
|
+
return acc;
|
12
|
+
}, {});
|
13
|
+
};
|
14
|
+
exports.getAppointmentCountsByStatus = getAppointmentCountsByStatus;
|
15
|
+
//# sourceMappingURL=getAppoitnmentCountByStatus.js.map
|
package/dist/extensions/elation/actions/findAppointmentsByPrompt/getAppoitnmentCountByStatus.js.map
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"getAppoitnmentCountByStatus.js","sourceRoot":"","sources":["../../../../../extensions/elation/actions/findAppointmentsByPrompt/getAppoitnmentCountByStatus.ts"],"names":[],"mappings":";;;AAGA,sEAA6D;AAEtD,MAAM,4BAA4B,GAAG,CACxC,YAAmC,EACX,EAAE;IAC1B,OAAO,MAAM,CAAC,MAAM,CAAC,4BAAU,CAAC,MAAM,CAAC,CAAC,MAAM,CAAyB,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE;QACrF,MAAM,GAAG,GAAG,YAAY,CAAC,MAAM,CAC7B,CAAC,WAAW,EAAE,EAAE,CAAC,CAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,MAAM,CAAC,MAAM,MAAK,MAAM,CACvD,CAAC,MAAM,CAAA;QACR,IAAI,GAAG,GAAG,CAAC,EAAE,CAAC;YACZ,GAAG,CAAC,MAAM,CAAC,GAAG,GAAG,CAAA;QACnB,CAAC;QACD,OAAO,GAAG,CAAA;IACZ,CAAC,EAAE,EAAE,CAAC,CAAA;AACR,CAAC,CAAA;AAZU,QAAA,4BAA4B,gCAYtC"}
|
@@ -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 AppointmentsFromAI } from './parser';
|
5
|
+
import { type AppointmentResponse } from '../../../../types';
|
6
|
+
interface FindAppointmentsByPromptWithLLMProps {
|
7
|
+
model: ChatOpenAI;
|
8
|
+
appointments: AppointmentResponse[];
|
9
|
+
prompt: string;
|
10
|
+
metadata: AIActionMetadata;
|
11
|
+
callbacks?: BaseCallbackHandler[];
|
12
|
+
}
|
13
|
+
export declare const findAppointmentsByPromptWithLLM: ({ model, appointments, prompt, metadata, callbacks, }: FindAppointmentsByPromptWithLLMProps) => Promise<AppointmentsFromAI>;
|
14
|
+
export {};
|
@@ -0,0 +1,36 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.findAppointmentsByPromptWithLLM = void 0;
|
4
|
+
const prompt_1 = require("./prompt");
|
5
|
+
const parser_1 = require("./parser");
|
6
|
+
const findAppointmentsByPromptWithLLM = async ({ model, appointments, prompt, metadata, callbacks, }) => {
|
7
|
+
const chain = model.pipe(parser_1.parser);
|
8
|
+
try {
|
9
|
+
const formattedAppointments = appointments
|
10
|
+
.map((appointment) => ({
|
11
|
+
id: appointment.id,
|
12
|
+
reason: appointment.reason,
|
13
|
+
scheduled_date: appointment.scheduled_date,
|
14
|
+
}))
|
15
|
+
.map((appointment) => JSON.stringify(appointment))
|
16
|
+
.join('\n\n');
|
17
|
+
const result = await chain.invoke(await prompt_1.systemPrompt.format({
|
18
|
+
currentDate: new Date().toISOString().split('T')[0],
|
19
|
+
appointments: formattedAppointments,
|
20
|
+
prompt,
|
21
|
+
}), {
|
22
|
+
metadata,
|
23
|
+
runName: 'ElationFindAppointmentsByPrompt',
|
24
|
+
callbacks
|
25
|
+
});
|
26
|
+
return {
|
27
|
+
appointmentIds: result.appointmentIds,
|
28
|
+
explanation: result.explanation
|
29
|
+
};
|
30
|
+
}
|
31
|
+
catch (error) {
|
32
|
+
throw new Error('Failed to find matching appointments.');
|
33
|
+
}
|
34
|
+
};
|
35
|
+
exports.findAppointmentsByPromptWithLLM = findAppointmentsByPromptWithLLM;
|
36
|
+
//# sourceMappingURL=findAppointmentsByPromptWithLLM.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"findAppointmentsByPromptWithLLM.js","sourceRoot":"","sources":["../../../../../../../extensions/elation/actions/findAppointmentsByPrompt/lib/findAppointmentsByPromptWithLLM/findAppointmentsByPromptWithLLM.ts"],"names":[],"mappings":";;;AAGA,qCAAuC;AACvC,qCAA0D;AAWnD,MAAM,+BAA+B,GAAG,KAAK,EAAE,EACpD,KAAK,EACL,YAAY,EACZ,MAAM,EACN,QAAQ,EACR,SAAS,GAC4B,EAA+B,EAAE;IACtE,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,eAAM,CAAC,CAAA;IAEhC,IAAI,CAAC;QACH,MAAM,qBAAqB,GAAG,YAAY;aACvC,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;YACrB,EAAE,EAAE,WAAW,CAAC,EAAE;YAClB,MAAM,EAAE,WAAW,CAAC,MAAM;YAC1B,cAAc,EAAE,WAAW,CAAC,cAAc;SAC3C,CAAC,CAAC;aACF,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;aACjD,IAAI,CAAC,MAAM,CAAC,CAAA;QAEf,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,MAAM,CAC/B,MAAM,qBAAY,CAAC,MAAM,CAAC;YACxB,WAAW,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YACnD,YAAY,EAAE,qBAAqB;YACnC,MAAM;SACP,CAAC,EACF;YACE,QAAQ;YACR,OAAO,EAAE,iCAAiC;YAC1C,SAAS;SACV,CACF,CAAA;QAED,OAAO;YACL,cAAc,EAAE,MAAM,CAAC,cAAc;YACrC,WAAW,EAAE,MAAM,CAAC,WAAW;SAChC,CAAA;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAA;IAC1D,CAAC;AACH,CAAC,CAAA;AAvCY,QAAA,+BAA+B,mCAuC3C"}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import { z } from 'zod';
|
2
|
+
import { StructuredOutputParser } from '@langchain/core/output_parsers';
|
3
|
+
export declare const AppointmentsSchema: z.ZodArray<z.ZodNumber, "many">;
|
4
|
+
export declare const parser: StructuredOutputParser<z.ZodObject<{
|
5
|
+
appointmentIds: z.ZodArray<z.ZodNumber, "many">;
|
6
|
+
explanation: z.ZodString;
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
8
|
+
explanation: string;
|
9
|
+
appointmentIds: number[];
|
10
|
+
}, {
|
11
|
+
explanation: string;
|
12
|
+
appointmentIds: number[];
|
13
|
+
}>>;
|
14
|
+
export interface AppointmentsFromAI {
|
15
|
+
appointmentIds: number[];
|
16
|
+
explanation: string;
|
17
|
+
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.parser = exports.AppointmentsSchema = void 0;
|
4
|
+
const zod_1 = require("zod");
|
5
|
+
const output_parsers_1 = require("@langchain/core/output_parsers");
|
6
|
+
exports.AppointmentsSchema = zod_1.z.array(zod_1.z.coerce.number())
|
7
|
+
.describe('Array of appointment IDs that match the criteria');
|
8
|
+
exports.parser = output_parsers_1.StructuredOutputParser.fromZodSchema(zod_1.z.object({
|
9
|
+
appointmentIds: exports.AppointmentsSchema,
|
10
|
+
explanation: zod_1.z
|
11
|
+
.string()
|
12
|
+
.describe('A readable explanation of how the appointments were found and why'),
|
13
|
+
}));
|
14
|
+
//# sourceMappingURL=parser.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"parser.js","sourceRoot":"","sources":["../../../../../../../extensions/elation/actions/findAppointmentsByPrompt/lib/findAppointmentsByPromptWithLLM/parser.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AACvB,mEAAuE;AAE1D,QAAA,kBAAkB,GAAG,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;KACzD,QAAQ,CAAC,kDAAkD,CAAC,CAAA;AAElD,QAAA,MAAM,GAAG,uCAAsB,CAAC,aAAa,CACxD,OAAC,CAAC,MAAM,CAAC;IACP,cAAc,EAAE,0BAAkB;IAClC,WAAW,EAAE,OAAC;SACX,MAAM,EAAE;SACR,QAAQ,CACP,mEAAmE,CACpE;CACJ,CAAC,CACH,CAAA"}
|
@@ -0,0 +1,2 @@
|
|
1
|
+
import { ChatPromptTemplate } from '@langchain/core/prompts';
|
2
|
+
export declare const systemPrompt: ChatPromptTemplate<import("@langchain/core/prompts").ParamsFromFString<"You are a helpful medical assistant. You will receive a list (array) of appointments for a single patient and instructions about which types of appointments to find. You're supposed to use the information in the list to find appointments that match, if any exist. If no appointments exists that obviously match the instructions, that's a perfectly acceptable outcome. If multiple appointments exist that match the instructions, you should return all of them.\n \nImportant instructions:\n- The appointment \"reason\" is the appointment type.\n- Only include appointment ids that exist in the input array. If no appointments exist that match the instructions, return an empty array.\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, and \"PT\" would match physical therapy.\n- The current date is {currentDate}.\n----------\nInput array: \n{appointments}\n----------\nInstruction: \n{prompt}\n----------\n\nOutput a JSON object with the following keys:\n1. appointmentIds: array of numbers representing appointment IDs that match the instructions (or an empty array if no appointments exist that match the instructions).\n2. explanation: A readable explanation of how the appointments were found and why. Or, if no appointments exist that match the instructions, an explanation of why.">, any>;
|
@@ -0,0 +1,24 @@
|
|
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(`You are a helpful medical assistant. You will receive a list (array) of appointments for a single patient and instructions about which types of appointments to find. You're supposed to use the information in the list to find appointments that match, if any exist. If no appointments exists that obviously match the instructions, that's a perfectly acceptable outcome. If multiple appointments exist that match the instructions, you should return all of them.
|
6
|
+
|
7
|
+
Important instructions:
|
8
|
+
- The appointment "reason" is the appointment type.
|
9
|
+
- Only include appointment ids that exist in the input array. If no appointments exist that match the instructions, return an empty array.
|
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, and "PT" would match physical therapy.
|
12
|
+
- The current date is {currentDate}.
|
13
|
+
----------
|
14
|
+
Input array:
|
15
|
+
{appointments}
|
16
|
+
----------
|
17
|
+
Instruction:
|
18
|
+
{prompt}
|
19
|
+
----------
|
20
|
+
|
21
|
+
Output a JSON object with the following keys:
|
22
|
+
1. appointmentIds: array of numbers representing appointment IDs that match the instructions (or an empty array if no appointments exist that match the instructions).
|
23
|
+
2. explanation: A readable explanation of how the appointments were found and why. Or, if no appointments exist that match the instructions, an explanation of why.`);
|
24
|
+
//# sourceMappingURL=prompt.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../../../../../../extensions/elation/actions/findAppointmentsByPrompt/lib/findAppointmentsByPromptWithLLM/prompt.ts"],"names":[],"mappings":";;;AAAA,qDAA4D;AAE/C,QAAA,YAAY,GAAG,4BAAkB,CAAC,YAAY,CAAC;;;;;;;;;;;;;;;;;;oKAkBwG,CACnK,CAAA"}
|
@@ -1,4 +1,4 @@
|
|
1
1
|
import { type Action } from '@awell-health/extensions-core';
|
2
|
-
import {
|
2
|
+
import type { settings } from '../../settings';
|
3
3
|
import { fields, dataPoints } from './config';
|
4
4
|
export declare const findFutureAppointment: Action<typeof fields, typeof settings, keyof typeof dataPoints>;
|