@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.
Files changed (325) hide show
  1. package/dist/extensions/cerner/actions/createPatient/__testdata__/CreateFhirPatient.mock.d.ts +8 -0
  2. package/dist/extensions/cerner/actions/createPatient/__testdata__/CreateFhirPatient.mock.js +12 -0
  3. package/dist/extensions/cerner/actions/createPatient/__testdata__/CreateFhirPatient.mock.js.map +1 -0
  4. package/dist/extensions/cerner/actions/createPatient/config/datapoints.d.ts +6 -1
  5. package/dist/extensions/cerner/actions/createPatient/config/datapoints.js +6 -1
  6. package/dist/extensions/cerner/actions/createPatient/config/datapoints.js.map +1 -1
  7. package/dist/extensions/cerner/actions/createPatient/config/fields.d.ts +70 -2
  8. package/dist/extensions/cerner/actions/createPatient/config/fields.js +61 -2
  9. package/dist/extensions/cerner/actions/createPatient/config/fields.js.map +1 -1
  10. package/dist/extensions/cerner/actions/createPatient/createPatient.js +61 -1
  11. package/dist/extensions/cerner/actions/createPatient/createPatient.js.map +1 -1
  12. package/dist/extensions/cerner/actions/getPatient/__testdata__/PatientRead.mock.d.ts +37 -0
  13. package/dist/extensions/cerner/actions/getPatient/__testdata__/PatientRead.mock.js +55 -0
  14. package/dist/extensions/cerner/actions/getPatient/__testdata__/PatientRead.mock.js.map +1 -0
  15. package/dist/extensions/cerner/actions/getPatient/config/datapoints.d.ts +6 -1
  16. package/dist/extensions/cerner/actions/getPatient/config/datapoints.js +6 -1
  17. package/dist/extensions/cerner/actions/getPatient/config/datapoints.js.map +1 -1
  18. package/dist/extensions/cerner/actions/getPatient/config/fields.d.ts +17 -2
  19. package/dist/extensions/cerner/actions/getPatient/config/fields.js +13 -2
  20. package/dist/extensions/cerner/actions/getPatient/config/fields.js.map +1 -1
  21. package/dist/extensions/cerner/actions/getPatient/getPatient.js +33 -2
  22. package/dist/extensions/cerner/actions/getPatient/getPatient.js.map +1 -1
  23. package/dist/extensions/cerner/actions/index.d.ts +31 -4
  24. package/dist/extensions/cerner/actions/index.js +2 -6
  25. package/dist/extensions/cerner/actions/index.js.map +1 -1
  26. package/dist/extensions/cerner/index.js +1 -1
  27. package/dist/extensions/cerner/index.js.map +1 -1
  28. package/dist/extensions/cerner/lib/api/FhirR4/FhirR4client-backup.d.ts +0 -0
  29. package/dist/extensions/cerner/lib/api/FhirR4/FhirR4client-backup.js +172 -0
  30. package/dist/extensions/cerner/lib/api/FhirR4/FhirR4client-backup.js.map +1 -0
  31. package/dist/extensions/cerner/lib/api/FhirR4/FhirR4client.d.ts +19 -0
  32. package/dist/extensions/cerner/lib/api/FhirR4/FhirR4client.js +45 -0
  33. package/dist/extensions/cerner/lib/api/FhirR4/FhirR4client.js.map +1 -0
  34. package/dist/extensions/cerner/lib/api/FhirR4/cacheService.d.ts +11 -0
  35. package/dist/extensions/cerner/lib/api/FhirR4/cacheService.js +15 -0
  36. package/dist/extensions/cerner/lib/api/FhirR4/cacheService.js.map +1 -0
  37. package/dist/extensions/cerner/lib/api/FhirR4/index.d.ts +1 -0
  38. package/dist/extensions/cerner/lib/api/FhirR4/index.js +18 -0
  39. package/dist/extensions/cerner/lib/api/FhirR4/index.js.map +1 -0
  40. package/dist/extensions/cerner/lib/api/FhirR4/schema/AppointmentRead.schema.d.ts +9 -0
  41. package/dist/extensions/cerner/lib/api/FhirR4/schema/AppointmentRead.schema.js +6 -0
  42. package/dist/extensions/cerner/lib/api/FhirR4/schema/AppointmentRead.schema.js.map +1 -0
  43. package/dist/extensions/cerner/lib/api/FhirR4/schema/DocumentReferenceCreate.schema.d.ts +7 -0
  44. package/dist/extensions/cerner/lib/api/FhirR4/schema/DocumentReferenceCreate.schema.js +3 -0
  45. package/dist/extensions/cerner/lib/api/FhirR4/schema/DocumentReferenceCreate.schema.js.map +1 -0
  46. package/dist/extensions/cerner/lib/api/FhirR4/schema/PatientCreate.schema.d.ts +7 -0
  47. package/dist/extensions/cerner/lib/api/FhirR4/schema/PatientCreate.schema.js +3 -0
  48. package/dist/extensions/cerner/lib/api/FhirR4/schema/PatientCreate.schema.js.map +1 -0
  49. package/dist/extensions/cerner/lib/api/FhirR4/schema/PatientMatch.schema.d.ts +37 -0
  50. package/dist/extensions/cerner/lib/api/FhirR4/schema/PatientMatch.schema.js +3 -0
  51. package/dist/extensions/cerner/lib/api/FhirR4/schema/PatientMatch.schema.js.map +1 -0
  52. package/dist/extensions/cerner/lib/api/FhirR4/schema/PatientRead.schema.d.ts +9 -0
  53. package/dist/extensions/cerner/lib/api/FhirR4/schema/PatientRead.schema.js +6 -0
  54. package/dist/extensions/cerner/lib/api/FhirR4/schema/PatientRead.schema.js.map +1 -0
  55. package/dist/extensions/cerner/lib/api/FhirR4/schema/PatientSearch.schema.d.ts +8 -0
  56. package/dist/extensions/cerner/lib/api/FhirR4/schema/PatientSearch.schema.js +3 -0
  57. package/dist/extensions/cerner/lib/api/FhirR4/schema/PatientSearch.schema.js.map +1 -0
  58. package/dist/extensions/cerner/lib/api/FhirR4/schema/index.d.ts +6 -0
  59. package/dist/extensions/cerner/lib/api/FhirR4/schema/index.js +23 -0
  60. package/dist/extensions/cerner/lib/api/FhirR4/schema/index.js.map +1 -0
  61. package/dist/extensions/cerner/lib/api/auth/constructCernerUrls.d.ts +4 -0
  62. package/dist/extensions/cerner/lib/api/auth/constructCernerUrls.js +11 -0
  63. package/dist/extensions/cerner/lib/api/auth/constructCernerUrls.js.map +1 -0
  64. package/dist/extensions/cerner/lib/api/auth/index.d.ts +1 -0
  65. package/dist/extensions/cerner/lib/api/auth/index.js +18 -0
  66. package/dist/extensions/cerner/lib/api/auth/index.js.map +1 -0
  67. package/dist/extensions/cerner/lib/validatePayloadAndCreateSdks.d.ts +18 -0
  68. package/dist/extensions/cerner/lib/validatePayloadAndCreateSdks.js +41 -0
  69. package/dist/extensions/cerner/lib/validatePayloadAndCreateSdks.js.map +1 -0
  70. package/dist/extensions/cerner/settings.d.ts +36 -2
  71. package/dist/extensions/cerner/settings.js +28 -2
  72. package/dist/extensions/cerner/settings.js.map +1 -1
  73. package/dist/extensions/dockHealth/lib/dock.types.d.ts +2 -2
  74. package/dist/extensions/elation/actions/findAppointmentsByPrompt/findAppointmentsByPrompt.js +33 -113
  75. package/dist/extensions/elation/actions/findAppointmentsByPrompt/findAppointmentsByPrompt.js.map +1 -1
  76. package/dist/extensions/elation/actions/findAppointmentsByPrompt/getAppoitnmentCountByStatus.d.ts +2 -0
  77. package/dist/extensions/elation/actions/findAppointmentsByPrompt/getAppoitnmentCountByStatus.js +15 -0
  78. package/dist/extensions/elation/actions/findAppointmentsByPrompt/getAppoitnmentCountByStatus.js.map +1 -0
  79. package/dist/extensions/elation/actions/findAppointmentsByPrompt/lib/findAppointmentsByPromptWithLLM/findAppointmentsByPromptWithLLM.d.ts +14 -0
  80. package/dist/extensions/elation/actions/findAppointmentsByPrompt/lib/findAppointmentsByPromptWithLLM/findAppointmentsByPromptWithLLM.js +36 -0
  81. package/dist/extensions/elation/actions/findAppointmentsByPrompt/lib/findAppointmentsByPromptWithLLM/findAppointmentsByPromptWithLLM.js.map +1 -0
  82. package/dist/extensions/elation/actions/findAppointmentsByPrompt/lib/findAppointmentsByPromptWithLLM/parser.d.ts +17 -0
  83. package/dist/extensions/elation/actions/findAppointmentsByPrompt/lib/findAppointmentsByPromptWithLLM/parser.js +14 -0
  84. package/dist/extensions/elation/actions/findAppointmentsByPrompt/lib/findAppointmentsByPromptWithLLM/parser.js.map +1 -0
  85. package/dist/extensions/elation/actions/findAppointmentsByPrompt/lib/findAppointmentsByPromptWithLLM/prompt.d.ts +2 -0
  86. package/dist/extensions/elation/actions/findAppointmentsByPrompt/lib/findAppointmentsByPromptWithLLM/prompt.js +24 -0
  87. package/dist/extensions/elation/actions/findAppointmentsByPrompt/lib/findAppointmentsByPromptWithLLM/prompt.js.map +1 -0
  88. package/dist/extensions/elation/actions/findFutureAppointment/findFutureAppointment.d.ts +1 -1
  89. package/dist/extensions/elation/actions/findFutureAppointment/findFutureAppointment.js +32 -90
  90. package/dist/extensions/elation/actions/findFutureAppointment/findFutureAppointment.js.map +1 -1
  91. package/dist/extensions/elation/actions/findFutureAppointment/formatAppointments.d.ts +2 -0
  92. package/dist/extensions/elation/actions/findFutureAppointment/formatAppointments.js +18 -0
  93. package/dist/extensions/elation/actions/findFutureAppointment/formatAppointments.js.map +1 -0
  94. package/dist/extensions/elation/actions/findFutureAppointment/getFutureAppoitnments.d.ts +3 -0
  95. package/dist/extensions/elation/actions/findFutureAppointment/getFutureAppoitnments.js +15 -0
  96. package/dist/extensions/elation/actions/findFutureAppointment/getFutureAppoitnments.js.map +1 -0
  97. package/dist/extensions/elation/actions/findFutureAppointment/lib/findAppointmentWithLLM/findAppointmentWithLLM.d.ts +14 -0
  98. package/dist/extensions/elation/actions/findFutureAppointment/lib/findAppointmentWithLLM/findAppointmentWithLLM.js +29 -0
  99. package/dist/extensions/elation/actions/findFutureAppointment/lib/findAppointmentWithLLM/findAppointmentWithLLM.js.map +1 -0
  100. package/dist/extensions/elation/actions/findFutureAppointment/lib/findAppointmentWithLLM/parser.d.ts +17 -0
  101. package/dist/extensions/elation/actions/findFutureAppointment/lib/findAppointmentWithLLM/parser.js +16 -0
  102. package/dist/extensions/elation/actions/findFutureAppointment/lib/findAppointmentWithLLM/parser.js.map +1 -0
  103. package/dist/extensions/elation/actions/findFutureAppointment/lib/findAppointmentWithLLM/prompt.d.ts +2 -0
  104. package/dist/extensions/elation/actions/findFutureAppointment/lib/findAppointmentWithLLM/prompt.js +20 -0
  105. package/dist/extensions/elation/actions/findFutureAppointment/lib/findAppointmentWithLLM/prompt.js.map +1 -0
  106. package/dist/extensions/elation/actions/index.d.ts +0 -210
  107. package/dist/extensions/elation/actions/updatePatientTags/config/types.d.ts +29 -0
  108. package/dist/extensions/elation/actions/updatePatientTags/config/types.js +21 -0
  109. package/dist/extensions/elation/actions/updatePatientTags/config/types.js.map +1 -0
  110. package/dist/extensions/elation/actions/updatePatientTags/lib/getTagsFromLLM/getTagsFromLLM.d.ts +13 -0
  111. package/dist/extensions/elation/actions/updatePatientTags/lib/getTagsFromLLM/getTagsFromLLM.js +29 -0
  112. package/dist/extensions/elation/actions/updatePatientTags/lib/getTagsFromLLM/getTagsFromLLM.js.map +1 -0
  113. package/dist/extensions/elation/actions/updatePatientTags/lib/getTagsFromLLM/parser.d.ts +13 -0
  114. package/dist/extensions/elation/actions/updatePatientTags/lib/getTagsFromLLM/parser.js +7 -0
  115. package/dist/extensions/elation/actions/updatePatientTags/lib/getTagsFromLLM/parser.js.map +1 -0
  116. package/dist/extensions/elation/actions/updatePatientTags/lib/getTagsFromLLM/prompt.d.ts +2 -0
  117. package/dist/extensions/elation/actions/updatePatientTags/lib/getTagsFromLLM/prompt.js +22 -0
  118. package/dist/extensions/elation/actions/updatePatientTags/lib/getTagsFromLLM/prompt.js.map +1 -0
  119. package/dist/extensions/elation/actions/updatePatientTags/updatePatientTags.d.ts +8 -0
  120. package/dist/extensions/elation/actions/updatePatientTags/updatePatientTags.js +35 -77
  121. package/dist/extensions/elation/actions/updatePatientTags/updatePatientTags.js.map +1 -1
  122. package/dist/extensions/elation/actions/updatePatientTags/updateTags.d.ts +2 -0
  123. package/dist/extensions/elation/actions/updatePatientTags/updateTags.js +18 -0
  124. package/dist/extensions/elation/actions/updatePatientTags/updateTags.js.map +1 -0
  125. package/dist/extensions/elation/settings.d.ts +1 -10
  126. package/dist/extensions/elation/settings.js +0 -8
  127. package/dist/extensions/elation/settings.js.map +1 -1
  128. package/dist/extensions/elation/validation/referralOrder.zod.d.ts +17 -17
  129. package/dist/extensions/epic/actions/createClinicalNote/config/fields.js +1 -1
  130. package/dist/extensions/epic/actions/createClinicalNote/config/fields.js.map +1 -1
  131. package/dist/extensions/epic/actions/createClinicalNote/createClinicalNote.js +1 -1
  132. package/dist/extensions/epic/actions/createClinicalNote/createClinicalNote.js.map +1 -1
  133. package/dist/extensions/epic/actions/createPatient/config/fields.js +1 -1
  134. package/dist/extensions/epic/actions/createPatient/config/fields.js.map +1 -1
  135. package/dist/extensions/epic/actions/matchPatient/config/fields.js +1 -1
  136. package/dist/extensions/epic/actions/matchPatient/config/fields.js.map +1 -1
  137. package/dist/extensions/epic/lib/api/customFhirSchemas/DocumentReference/Status.schema.js.map +1 -0
  138. package/dist/extensions/epic/lib/api/customFhirSchemas/DocumentReference/Type.schema.js.map +1 -0
  139. package/dist/extensions/epic/lib/api/{schemas → customFhirSchemas}/DocumentReference/index.js +1 -1
  140. package/dist/extensions/epic/lib/api/customFhirSchemas/DocumentReference/index.js.map +1 -0
  141. package/dist/extensions/markdown.json +1 -1
  142. package/dist/extensions/medplum/actions/createServiceRequest/config/fields.js +4 -6
  143. package/dist/extensions/medplum/actions/createServiceRequest/config/fields.js.map +1 -1
  144. package/dist/extensions/medplum/actions/createTask/config/fields.js +4 -6
  145. package/dist/extensions/medplum/actions/createTask/config/fields.js.map +1 -1
  146. package/dist/extensions/medplum/fhir/schemas/resources/patient.schema.js +2 -2
  147. package/dist/extensions/medplum/fhir/schemas/resources/patient.schema.js.map +1 -1
  148. package/dist/extensions/medplum/fhir/schemas/resources/serviceRequest.schema.js +5 -5
  149. package/dist/extensions/medplum/fhir/schemas/resources/serviceRequest.schema.js.map +1 -1
  150. package/dist/extensions/medplum/fhir/schemas/resources/task.schema.js +4 -4
  151. package/dist/extensions/medplum/fhir/schemas/resources/task.schema.js.map +1 -1
  152. package/dist/extensions/shelly/actions/categorizeMessage/categorizeMessage.d.ts +10 -2
  153. package/dist/extensions/shelly/actions/categorizeMessage/categorizeMessage.js +32 -24
  154. package/dist/extensions/shelly/actions/categorizeMessage/categorizeMessage.js.map +1 -1
  155. package/dist/extensions/shelly/actions/categorizeMessage/lib/categorizeMessageWithLLM/categorizeMessageWithLLM.d.ts +22 -2
  156. package/dist/extensions/shelly/actions/categorizeMessage/lib/categorizeMessageWithLLM/categorizeMessageWithLLM.js +22 -7
  157. package/dist/extensions/shelly/actions/categorizeMessage/lib/categorizeMessageWithLLM/categorizeMessageWithLLM.js.map +1 -1
  158. package/dist/extensions/shelly/actions/categorizeMessage/lib/categorizeMessageWithLLM/parser.d.ts +20 -0
  159. package/dist/extensions/shelly/actions/categorizeMessage/lib/categorizeMessageWithLLM/parser.js +18 -0
  160. package/dist/extensions/shelly/actions/categorizeMessage/lib/categorizeMessageWithLLM/parser.js.map +1 -0
  161. package/dist/extensions/shelly/actions/categorizeMessage/lib/categorizeMessageWithLLM/prompt.d.ts +13 -0
  162. package/dist/extensions/shelly/actions/categorizeMessage/lib/categorizeMessageWithLLM/prompt.js +35 -0
  163. package/dist/extensions/shelly/actions/categorizeMessage/lib/categorizeMessageWithLLM/prompt.js.map +1 -0
  164. package/dist/extensions/shelly/actions/generateMessage/generateMessage.d.ts +10 -2
  165. package/dist/extensions/shelly/actions/generateMessage/generateMessage.js +33 -25
  166. package/dist/extensions/shelly/actions/generateMessage/generateMessage.js.map +1 -1
  167. package/dist/extensions/shelly/actions/generateMessage/lib/generateMessageWithLLM/generateMessageWithLLM.d.ts +18 -2
  168. package/dist/extensions/shelly/actions/generateMessage/lib/generateMessageWithLLM/generateMessageWithLLM.js +23 -10
  169. package/dist/extensions/shelly/actions/generateMessage/lib/generateMessageWithLLM/generateMessageWithLLM.js.map +1 -1
  170. package/dist/extensions/shelly/actions/generateMessage/lib/generateMessageWithLLM/parser.d.ts +28 -0
  171. package/dist/extensions/shelly/actions/generateMessage/lib/generateMessageWithLLM/parser.js +17 -0
  172. package/dist/extensions/shelly/actions/generateMessage/lib/generateMessageWithLLM/parser.js.map +1 -0
  173. package/dist/extensions/shelly/actions/generateMessage/lib/generateMessageWithLLM/prompt.d.ts +10 -0
  174. package/dist/extensions/shelly/actions/generateMessage/lib/generateMessageWithLLM/prompt.js +121 -0
  175. package/dist/extensions/shelly/actions/generateMessage/lib/generateMessageWithLLM/prompt.js.map +1 -0
  176. package/dist/extensions/shelly/actions/index.d.ts +7 -63
  177. package/dist/extensions/shelly/actions/medicationFromImage/medicationFromImage.d.ts +1 -2
  178. package/dist/extensions/shelly/actions/medicationFromImage/medicationFromImage.js.map +1 -1
  179. package/dist/extensions/shelly/actions/reviewMedicationExtraction/reviewMedicationExtraction.d.ts +1 -2
  180. package/dist/extensions/shelly/actions/reviewMedicationExtraction/reviewMedicationExtraction.js.map +1 -1
  181. package/dist/extensions/shelly/actions/summarizeCareFlow/lib/summarizeCareFlowWithLLM/{constants.js → prompt.js} +1 -1
  182. package/dist/extensions/shelly/actions/summarizeCareFlow/lib/summarizeCareFlowWithLLM/prompt.js.map +1 -0
  183. package/dist/extensions/shelly/actions/summarizeCareFlow/lib/summarizeCareFlowWithLLM/summarizeCareFlowWithLLM.d.ts +22 -2
  184. package/dist/extensions/shelly/actions/summarizeCareFlow/lib/summarizeCareFlowWithLLM/summarizeCareFlowWithLLM.js +30 -8
  185. package/dist/extensions/shelly/actions/summarizeCareFlow/lib/summarizeCareFlowWithLLM/summarizeCareFlowWithLLM.js.map +1 -1
  186. package/dist/extensions/shelly/actions/summarizeCareFlow/summarizeCareFlow.d.ts +1 -2
  187. package/dist/extensions/shelly/actions/summarizeCareFlow/summarizeCareFlow.js +24 -21
  188. package/dist/extensions/shelly/actions/summarizeCareFlow/summarizeCareFlow.js.map +1 -1
  189. package/dist/extensions/shelly/actions/summarizeForm/summarizeForm.d.ts +10 -2
  190. package/dist/extensions/shelly/actions/summarizeForm/summarizeForm.js +42 -28
  191. package/dist/extensions/shelly/actions/summarizeForm/summarizeForm.js.map +1 -1
  192. package/dist/extensions/shelly/actions/summarizeFormsInStep/summarizeFormsInStep.d.ts +1 -2
  193. package/dist/extensions/shelly/actions/summarizeFormsInStep/summarizeFormsInStep.js +29 -26
  194. package/dist/extensions/shelly/actions/summarizeFormsInStep/summarizeFormsInStep.js.map +1 -1
  195. package/dist/extensions/shelly/index.js +2 -3
  196. package/dist/extensions/shelly/index.js.map +1 -1
  197. package/dist/extensions/shelly/lib/summarizeFormWithLLM/{constants.js → prompt.js} +1 -1
  198. package/dist/extensions/shelly/lib/summarizeFormWithLLM/prompt.js.map +1 -0
  199. package/dist/extensions/shelly/lib/summarizeFormWithLLM/summarizeFormWithLLM.d.ts +23 -2
  200. package/dist/extensions/shelly/lib/summarizeFormWithLLM/summarizeFormWithLLM.js +33 -9
  201. package/dist/extensions/shelly/lib/summarizeFormWithLLM/summarizeFormWithLLM.js.map +1 -1
  202. package/dist/extensions/shelly/lib/validatePayloadAndCreateSdk.d.ts +1 -5
  203. package/dist/extensions/shelly/lib/validatePayloadAndCreateSdk.js +5 -20
  204. package/dist/extensions/shelly/lib/validatePayloadAndCreateSdk.js.map +1 -1
  205. package/dist/extensions/zendesk/v1/actions/createTask/config/fields.d.ts +2 -2
  206. package/dist/src/lib/fhir/schemas/Appointment/Status.schema.js.map +1 -0
  207. package/dist/src/lib/fhir/schemas/Appointment/index.js.map +1 -0
  208. package/dist/src/lib/fhir/schemas/Patient/Gender.schema.js.map +1 -0
  209. package/dist/src/lib/fhir/schemas/Patient/index.js.map +1 -0
  210. package/dist/{extensions/medplum/fhir/schemas/atoms/IntentSchema.d.ts → src/lib/fhir/schemas/ServiceRequest/Intent.schema.d.ts} +0 -1
  211. package/dist/{extensions/medplum/fhir/schemas/atoms/IntentSchema.js → src/lib/fhir/schemas/ServiceRequest/Intent.schema.js} +2 -13
  212. package/dist/src/lib/fhir/schemas/ServiceRequest/Intent.schema.js.map +1 -0
  213. package/dist/{extensions/medplum/fhir/schemas/atoms/PrioritySchema.js → src/lib/fhir/schemas/ServiceRequest/Priority.schema.js} +1 -1
  214. package/dist/src/lib/fhir/schemas/ServiceRequest/Priority.schema.js.map +1 -0
  215. package/dist/src/lib/fhir/schemas/ServiceRequest/Status.schema.d.ts +2 -0
  216. package/dist/src/lib/fhir/schemas/ServiceRequest/Status.schema.js +14 -0
  217. package/dist/src/lib/fhir/schemas/ServiceRequest/Status.schema.js.map +1 -0
  218. package/dist/src/lib/fhir/schemas/ServiceRequest/index.d.ts +3 -0
  219. package/dist/src/lib/fhir/schemas/ServiceRequest/index.js +20 -0
  220. package/dist/src/lib/fhir/schemas/ServiceRequest/index.js.map +1 -0
  221. package/dist/src/lib/fhir/schemas/Shared/PeriodSchema.js.map +1 -0
  222. package/dist/src/lib/fhir/schemas/Shared/index.d.ts +1 -0
  223. package/dist/src/lib/fhir/schemas/Shared/index.js +18 -0
  224. package/dist/src/lib/fhir/schemas/Shared/index.js.map +1 -0
  225. package/dist/src/lib/fhir/schemas/Task/IntentSchema.d.ts +2 -0
  226. package/dist/src/lib/fhir/schemas/Task/IntentSchema.js +16 -0
  227. package/dist/src/lib/fhir/schemas/Task/IntentSchema.js.map +1 -0
  228. package/dist/src/lib/fhir/schemas/Task/Priority.schema.d.ts +2 -0
  229. package/dist/src/lib/fhir/schemas/Task/Priority.schema.js +6 -0
  230. package/dist/src/lib/fhir/schemas/Task/Priority.schema.js.map +1 -0
  231. package/dist/{extensions/medplum/fhir/schemas/atoms/StatusSchema.d.ts → src/lib/fhir/schemas/Task/Status.schema.d.ts} +0 -1
  232. package/dist/{extensions/medplum/fhir/schemas/atoms/StatusSchema.js → src/lib/fhir/schemas/Task/Status.schema.js} +2 -11
  233. package/dist/src/lib/fhir/schemas/Task/Status.schema.js.map +1 -0
  234. package/dist/src/lib/fhir/schemas/Task/index.d.ts +3 -0
  235. package/dist/src/lib/fhir/schemas/Task/index.js +20 -0
  236. package/dist/src/lib/fhir/schemas/Task/index.js.map +1 -0
  237. package/dist/src/lib/llm/openai/constants.d.ts +28 -0
  238. package/dist/src/lib/llm/openai/constants.js +32 -0
  239. package/dist/src/lib/llm/openai/constants.js.map +1 -0
  240. package/dist/src/lib/llm/openai/createOpenAIModel.d.ts +23 -0
  241. package/dist/src/lib/llm/openai/createOpenAIModel.js +89 -0
  242. package/dist/src/lib/llm/openai/createOpenAIModel.js.map +1 -0
  243. package/dist/src/lib/llm/openai/index.d.ts +3 -0
  244. package/dist/src/lib/llm/openai/index.js +20 -0
  245. package/dist/src/lib/llm/openai/index.js.map +1 -0
  246. package/dist/src/lib/llm/openai/types.d.ts +63 -0
  247. package/dist/src/lib/llm/openai/types.js +3 -0
  248. package/dist/src/lib/llm/openai/types.js.map +1 -0
  249. package/package.json +5 -4
  250. package/dist/extensions/cerner/actions/createClinicalNote/config/datapoints.d.ts +0 -1
  251. package/dist/extensions/cerner/actions/createClinicalNote/config/datapoints.js +0 -5
  252. package/dist/extensions/cerner/actions/createClinicalNote/config/datapoints.js.map +0 -1
  253. package/dist/extensions/cerner/actions/createClinicalNote/config/fields.d.ts +0 -3
  254. package/dist/extensions/cerner/actions/createClinicalNote/config/fields.js +0 -10
  255. package/dist/extensions/cerner/actions/createClinicalNote/config/fields.js.map +0 -1
  256. package/dist/extensions/cerner/actions/createClinicalNote/config/index.d.ts +0 -2
  257. package/dist/extensions/cerner/actions/createClinicalNote/config/index.js +0 -9
  258. package/dist/extensions/cerner/actions/createClinicalNote/config/index.js.map +0 -1
  259. package/dist/extensions/cerner/actions/createClinicalNote/createClinicalNote.d.ts +0 -4
  260. package/dist/extensions/cerner/actions/createClinicalNote/createClinicalNote.js +0 -18
  261. package/dist/extensions/cerner/actions/createClinicalNote/createClinicalNote.js.map +0 -1
  262. package/dist/extensions/cerner/actions/createClinicalNote/index.d.ts +0 -1
  263. package/dist/extensions/cerner/actions/createClinicalNote/index.js +0 -6
  264. package/dist/extensions/cerner/actions/createClinicalNote/index.js.map +0 -1
  265. package/dist/extensions/cerner/actions/getAppointment/config/datapoints.d.ts +0 -1
  266. package/dist/extensions/cerner/actions/getAppointment/config/datapoints.js +0 -5
  267. package/dist/extensions/cerner/actions/getAppointment/config/datapoints.js.map +0 -1
  268. package/dist/extensions/cerner/actions/getAppointment/config/fields.d.ts +0 -3
  269. package/dist/extensions/cerner/actions/getAppointment/config/fields.js +0 -10
  270. package/dist/extensions/cerner/actions/getAppointment/config/fields.js.map +0 -1
  271. package/dist/extensions/cerner/actions/getAppointment/config/index.d.ts +0 -2
  272. package/dist/extensions/cerner/actions/getAppointment/config/index.js +0 -9
  273. package/dist/extensions/cerner/actions/getAppointment/config/index.js.map +0 -1
  274. package/dist/extensions/cerner/actions/getAppointment/getAppointment.d.ts +0 -4
  275. package/dist/extensions/cerner/actions/getAppointment/getAppointment.js +0 -18
  276. package/dist/extensions/cerner/actions/getAppointment/getAppointment.js.map +0 -1
  277. package/dist/extensions/cerner/actions/getAppointment/index.d.ts +0 -1
  278. package/dist/extensions/cerner/actions/getAppointment/index.js +0 -6
  279. package/dist/extensions/cerner/actions/getAppointment/index.js.map +0 -1
  280. package/dist/extensions/epic/lib/api/schemas/Appointment/Status.schema.js.map +0 -1
  281. package/dist/extensions/epic/lib/api/schemas/Appointment/index.js.map +0 -1
  282. package/dist/extensions/epic/lib/api/schemas/DocumentReference/Status.schema.js.map +0 -1
  283. package/dist/extensions/epic/lib/api/schemas/DocumentReference/Type.schema.js.map +0 -1
  284. package/dist/extensions/epic/lib/api/schemas/DocumentReference/index.js.map +0 -1
  285. package/dist/extensions/epic/lib/api/schemas/Patient/Gender.schema.js.map +0 -1
  286. package/dist/extensions/epic/lib/api/schemas/Patient/index.js.map +0 -1
  287. package/dist/extensions/medplum/fhir/schemas/atoms/GenderSchema.d.ts +0 -2
  288. package/dist/extensions/medplum/fhir/schemas/atoms/GenderSchema.js +0 -6
  289. package/dist/extensions/medplum/fhir/schemas/atoms/GenderSchema.js.map +0 -1
  290. package/dist/extensions/medplum/fhir/schemas/atoms/IntentSchema.js.map +0 -1
  291. package/dist/extensions/medplum/fhir/schemas/atoms/PeriodSchema.js.map +0 -1
  292. package/dist/extensions/medplum/fhir/schemas/atoms/PrioritySchema.js.map +0 -1
  293. package/dist/extensions/medplum/fhir/schemas/atoms/StatusSchema.js.map +0 -1
  294. package/dist/extensions/medplum/fhir/schemas/atoms/index.d.ts +0 -5
  295. package/dist/extensions/medplum/fhir/schemas/atoms/index.js +0 -16
  296. package/dist/extensions/medplum/fhir/schemas/atoms/index.js.map +0 -1
  297. package/dist/extensions/shelly/actions/categorizeMessage/lib/categorizeMessageWithLLM/constants.d.ts +0 -24
  298. package/dist/extensions/shelly/actions/categorizeMessage/lib/categorizeMessageWithLLM/constants.js +0 -33
  299. package/dist/extensions/shelly/actions/categorizeMessage/lib/categorizeMessageWithLLM/constants.js.map +0 -1
  300. package/dist/extensions/shelly/actions/generateMessage/lib/generateMessageWithLLM/constants.d.ts +0 -24
  301. package/dist/extensions/shelly/actions/generateMessage/lib/generateMessageWithLLM/constants.js +0 -123
  302. package/dist/extensions/shelly/actions/generateMessage/lib/generateMessageWithLLM/constants.js.map +0 -1
  303. package/dist/extensions/shelly/actions/summarizeCareFlow/lib/summarizeCareFlowWithLLM/constants.js.map +0 -1
  304. package/dist/extensions/shelly/lib/summarizeFormWithLLM/constants.js.map +0 -1
  305. package/dist/extensions/shelly/settings.d.ts +0 -17
  306. package/dist/extensions/shelly/settings.js +0 -17
  307. package/dist/extensions/shelly/settings.js.map +0 -1
  308. package/dist/extensions/epic/lib/api/{schemas → customFhirSchemas}/DocumentReference/Status.schema.d.ts +0 -0
  309. package/dist/extensions/epic/lib/api/{schemas → customFhirSchemas}/DocumentReference/Status.schema.js +0 -0
  310. package/dist/extensions/epic/lib/api/{schemas → customFhirSchemas}/DocumentReference/Type.schema.d.ts +0 -0
  311. package/dist/extensions/epic/lib/api/{schemas → customFhirSchemas}/DocumentReference/Type.schema.js +0 -0
  312. package/dist/extensions/epic/lib/api/{schemas → customFhirSchemas}/DocumentReference/index.d.ts +1 -1
  313. /package/dist/extensions/shelly/actions/summarizeCareFlow/lib/summarizeCareFlowWithLLM/{constants.d.ts → prompt.d.ts} +0 -0
  314. /package/dist/extensions/shelly/lib/summarizeFormWithLLM/{constants.d.ts → prompt.d.ts} +0 -0
  315. /package/dist/{extensions/epic/lib/api → src/lib/fhir}/schemas/Appointment/Status.schema.d.ts +0 -0
  316. /package/dist/{extensions/epic/lib/api → src/lib/fhir}/schemas/Appointment/Status.schema.js +0 -0
  317. /package/dist/{extensions/epic/lib/api → src/lib/fhir}/schemas/Appointment/index.d.ts +0 -0
  318. /package/dist/{extensions/epic/lib/api → src/lib/fhir}/schemas/Appointment/index.js +0 -0
  319. /package/dist/{extensions/epic/lib/api → src/lib/fhir}/schemas/Patient/Gender.schema.d.ts +0 -0
  320. /package/dist/{extensions/epic/lib/api → src/lib/fhir}/schemas/Patient/Gender.schema.js +0 -0
  321. /package/dist/{extensions/epic/lib/api → src/lib/fhir}/schemas/Patient/index.d.ts +0 -0
  322. /package/dist/{extensions/epic/lib/api → src/lib/fhir}/schemas/Patient/index.js +0 -0
  323. /package/dist/{extensions/medplum/fhir/schemas/atoms/PrioritySchema.d.ts → src/lib/fhir/schemas/ServiceRequest/Priority.schema.d.ts} +0 -0
  324. /package/dist/{extensions/medplum/fhir/schemas/atoms → src/lib/fhir/schemas/Shared}/PeriodSchema.d.ts +0 -0
  325. /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
- export declare const SettingsValidationSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
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
- exports.SettingsValidationSchema = zod_1.z.object({});
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,EAAoC,CAAA;AAE/C,QAAA,wBAAwB,GAAG,OAAC,CAAC,MAAM,CAAC,EAAsD,CAAC,CAAA"}
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
  }>;
@@ -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 output_parsers_1 = require("@langchain/core/output_parsers");
8
- const zod_1 = require("zod");
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(appointments),
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 chain = ChatModelGPT4o.pipe(parser);
84
- result = await chain.invoke(systemPrompt);
85
- }
86
- catch (invokeError) {
87
- console.error('Error invoking ChatModelGPT4o for findFutureAppointment:', invokeError);
88
- throw new Error('Failed to find future appointment.');
89
- }
90
- const selectedAppointments = result.appointmentIds.map((appointmentId) => appointments.find((appointment) => appointment.id === Number(appointmentId)));
91
- if (Object.keys(selectedAppointments).length === 0) {
92
- console.log('No appointments found');
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
- explanation: result.explanation,
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
- if (selectedAppointments.length !== result.appointmentIds.length) {
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: errorMessage },
69
+ text: { en: 'Failed to find appointments' },
108
70
  error: {
109
71
  category: 'SERVER_ERROR',
110
- message: errorMessage,
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
@@ -1 +1 @@
1
- {"version":3,"file":"findAppointmentsByPrompt.js","sourceRoot":"","sources":["../../../../../extensions/elation/actions/findAppointmentsByPrompt/findAppointmentsByPrompt.ts"],"names":[],"mappings":";;;AAAA,mEAAqE;AAErE,yCAA4C;AAC5C,qCAAqE;AACrE,mEAAuE;AACvE,6BAAuB;AACvB,8CAA8C;AAC9C,uEAA2E;AAC3E,sEAA6D;AAC7D,mCAA8B;AAEjB,QAAA,wBAAwB,GAIjC;IACF,GAAG,EAAE,0BAA0B;IAC/B,QAAQ,EAAE,0BAAQ,CAAC,gBAAgB;IACnC,KAAK,EAAE,gCAAgC;IACvC,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,EAAiB,EAAE;QACjE,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,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAA;QAElD,IAAI,YAAY,KAAK,SAAS,IAAI,YAAY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B,CAAC,MAAM,6BAA6B,SAAS,kBAAkB,MAAM,CAAC,WAAW,mCAAmC,IAAI,CAAC,SAAS,CAAC,yBAAyB,CAAC,EAAE;iBACtM,CAAC;aACH;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,MAAM,kBAAkB,GAAG,CAAC,EAC1B,MAAM,EACN,YAAY,GAIb,EAAE,EAAE;IACH,MAAM,WAAW,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAA;IACxC,OAAO;;;;;;;8BAOqB,WAAW;;;EAGvC,YAAY;;;EAGZ,MAAM;;;;;oKAK4J,CAAA;AACpK,CAAC,CAAA"}
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,SA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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"}
@@ -0,0 +1,2 @@
1
+ import { type AppointmentResponse } from 'extensions/elation/types';
2
+ export declare const getAppointmentCountsByStatus: (appointments: AppointmentResponse[]) => Record<string, number>;
@@ -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
@@ -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 { type settings } from '../../settings';
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>;