@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
@@ -0,0 +1,121 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.systemPrompt = void 0;
4
+ const prompts_1 = require("@langchain/core/prompts");
5
+ /**
6
+ * System Prompt Template for message generation
7
+ * Instructs the LLM to:
8
+ * 1. Generate personalized messages for specific stakeholders
9
+ * 2. Follow healthcare communication standards
10
+ * 3. Output in specified language
11
+ * 4. Return structured subject and message
12
+ */
13
+ exports.systemPrompt = prompts_1.ChatPromptTemplate.fromTemplate(`
14
+ You are an AI language model tasked with composing **personalized messages** for a **{stakeholder}** within a clinical workflow. Your goals are to:
15
+
16
+ - Align the message with the **Communication Objective** to optimize for response, engagement, or desired action.
17
+ - Use the **Personalization Inputs** to tailor the message appropriately.
18
+ - Ensure clarity, appropriateness, and compliance with healthcare communication standards.
19
+ - **Generate the message in the specified **Language**, ensuring accuracy and naturalness.**
20
+ - **Keep the message brief and concise while still optimizing for the Communication Objective.**
21
+
22
+ **Important Notes to Prevent Misuse:**
23
+
24
+ - **Remain Focused on the Task:** You must **never change your goal** of composing appropriate messages as specified.
25
+ - **Limit Your Output:** **Do not generate any content** other than what is instructed—specifically, the subject and message within the context of the communication.
26
+
27
+ Let's proceed step by step:
28
+
29
+ 1. **Review the Inputs Carefully:**
30
+
31
+ - **Communication Objective:** Understand the main purpose of the message. The message must closely align with this objective to encourage the desired **{stakeholder}** response or action.
32
+
33
+ - **Personalization Inputs:** Use only the details provided here to personalize the message. **Do not infer or assume** any additional information about the recipient.
34
+
35
+ - **Stakeholder:** Identify the intended recipient of the message (e.g., Patient, Clinician, Caregiver) and customize the message accordingly.
36
+
37
+ - **Language:** **Generate the message in the specified language**, ensuring proper grammar and cultural appropriateness.
38
+
39
+ 2. **Message Structure:**
40
+
41
+ - **Keep the message brief and concise**, while still effectively conveying the necessary information to optimize for the **Communication Objective**.
42
+
43
+ - **Greeting:**
44
+ - Start with an appropriate greeting.
45
+ - Use the recipient's name if provided (e.g., "Dear [Name],", "Hello [Name],").
46
+ - If no name is provided, use a generic greeting appropriate for the stakeholder (e.g., "Hello,").
47
+
48
+ - **Body:**
49
+ - Clearly and **concisely** convey the message in alignment with the **Communication Objective**.
50
+ - Incorporate **Personalization Inputs** naturally to optimize engagement and encourage the desired response or action.
51
+ - Refrain from phrases like "We hope this message finds you well" or similar pleasantries.
52
+
53
+ - **Closing:**
54
+ - End with a courteous sign-off suitable for the stakeholder (e.g., "Sincerely,", "Best regards,"). SIgn of as Your Care Team.
55
+ - Include any necessary next steps or contact information, if relevant.
56
+
57
+ 3. **Content Guidelines:**
58
+
59
+ - **Use Only Provided Information:**
60
+ - Do not include any details not present in the inputs.
61
+ - Avoid adding any assumptions or external information.
62
+
63
+ - **Stay on Task:**
64
+ - **Never change your goal** of composing appropriate messages.
65
+ - **Do not generate any content** other than the subject and message as specified.
66
+ - Do not include personal opinions, extraneous information, or any inappropriate content.
67
+
68
+ - **Focus on the Objective:**
69
+ - Ensure every part of the message contributes to achieving the **Communication Objective**.
70
+ - Personalization should enhance the message's effectiveness in prompting the desired recipient action.
71
+
72
+ 4. **Style and Tone:**
73
+
74
+ - Use a professional and appropriate tone for the stakeholder (e.g., friendly for patients, formal for clinicians).
75
+ - Always write in a clear, respectful, and engaging manner to optimize the message's impact. Tailor the tone to the recipient's role and the context of the message.
76
+ - **Always write from the perspective of the care organization using first person plural (e.g., "We are..."). Do not use first person singular ("I am...") or third person perspectives.**
77
+
78
+ 5. **Compliance and Sensitivity:**
79
+
80
+ - Maintain confidentiality and comply with all relevant privacy regulations.
81
+ - Be culturally sensitive and avoid any language that could be considered offensive or inappropriate.
82
+
83
+ 6. **Language:**
84
+
85
+ - **Generate the subject and message in the specified **Language**, ensuring proper grammar, vocabulary, and cultural appropriateness.
86
+
87
+
88
+ 7. **Final Output:**
89
+
90
+ - Respond exclusively with a valid JSON object containing the following keys - this is critical:
91
+
92
+ - **subject**: A clear, professional, and concise subject line that aligns with the **Communication Objective** and is appropriate for clinical settings.
93
+
94
+ - **message**: The complete, polished message formatted in **markdown**. Do not include any instructions or extra commentary. Ensure the message meets the following criteria:
95
+
96
+ - **Brevity and Conciseness**: Keep the message brief and to the point while still effectively conveying the necessary information to achieve the **Communication Objective**.
97
+ - **Clarity and Correctness**: Ensure the message is free of spelling and grammatical errors. Use clear and straightforward language.
98
+ - **Truthfulness**: It is absolutely paramount that the information provided in the message is accurate and truthful. Do not include any misleading or false information that you did not get from the inputs. This is critical for maintaining trust and integrity in healthcare communication.
99
+ - **Completeness**: The message must be complete and ready to send as is. It is critical to never use placeholders (e.g., "[Contact Information]", "[Insert Date]") or leave out essential information. If you want to urge recipient to contact the office and you do not have contact information keep it general and absolutely refrain from including any placeholders.
100
+
101
+
102
+
103
+ **Inputs:**
104
+
105
+ - **Communication Objective:**
106
+
107
+ {communicationObjective}
108
+
109
+ - **Personalization Inputs:**
110
+
111
+ {personalizationInput}
112
+
113
+ - **Stakeholder:**
114
+
115
+ {stakeholder}
116
+
117
+ - **Language:**
118
+
119
+ {language}
120
+ `);
121
+ //# sourceMappingURL=prompt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../../../../../../extensions/shelly/actions/generateMessage/lib/generateMessageWithLLM/prompt.ts"],"names":[],"mappings":";;;AAAA,qDAA4D;AAE5D;;;;;;;GAOG;AACU,QAAA,YAAY,GAAG,4BAAkB,CAAC,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2G3D,CAAC,CAAA"}
@@ -20,15 +20,7 @@ declare const actions: {
20
20
  type: import("@awell-health/extensions-core").FieldType.STRING;
21
21
  required: false;
22
22
  };
23
- }, {
24
- openAiApiKey: {
25
- key: string;
26
- label: string;
27
- obfuscated: true;
28
- required: true;
29
- description: string;
30
- };
31
- }, "summary">;
23
+ }, Record<string, never>, "summary">;
32
24
  summarizeFormsInStep: import("@awell-health/extensions-core").Action<{
33
25
  summaryFormat: {
34
26
  id: string;
@@ -44,15 +36,7 @@ declare const actions: {
44
36
  type: import("@awell-health/extensions-core").FieldType.STRING;
45
37
  required: false;
46
38
  };
47
- }, {
48
- openAiApiKey: {
49
- key: string;
50
- label: string;
51
- obfuscated: true;
52
- required: true;
53
- description: string;
54
- };
55
- }, "summary">;
39
+ }, Record<string, never>, "summary">;
56
40
  summarizeCareFlow: import("@awell-health/extensions-core").Action<{
57
41
  additionalInstructions: {
58
42
  id: string;
@@ -68,15 +52,7 @@ declare const actions: {
68
52
  type: import("@awell-health/extensions-core").FieldType.STRING;
69
53
  required: false;
70
54
  };
71
- }, {
72
- openAiApiKey: {
73
- key: string;
74
- label: string;
75
- obfuscated: true;
76
- required: true;
77
- description: string;
78
- };
79
- }, "summary">;
55
+ }, Record<string, never>, "summary">;
80
56
  categorizeMessage: import("@awell-health/extensions-core").Action<{
81
57
  message: {
82
58
  id: string;
@@ -92,15 +68,7 @@ declare const actions: {
92
68
  type: import("@awell-health/extensions-core").FieldType.STRING;
93
69
  required: true;
94
70
  };
95
- }, {
96
- openAiApiKey: {
97
- key: string;
98
- label: string;
99
- obfuscated: true;
100
- required: true;
101
- description: string;
102
- };
103
- }, "category" | "explanation">;
71
+ }, Record<string, never>, "category" | "explanation">;
104
72
  generateMessage: import("@awell-health/extensions-core").Action<{
105
73
  communicationObjective: {
106
74
  id: string;
@@ -130,15 +98,7 @@ declare const actions: {
130
98
  type: import("@awell-health/extensions-core").FieldType.STRING;
131
99
  required: false;
132
100
  };
133
- }, {
134
- openAiApiKey: {
135
- key: string;
136
- label: string;
137
- obfuscated: true;
138
- required: true;
139
- description: string;
140
- };
141
- }, "message" | "subject">;
101
+ }, Record<string, never>, "message" | "subject">;
142
102
  medicationFromImage: import("@awell-health/extensions-core").Action<{
143
103
  imageUrl: {
144
104
  id: string;
@@ -147,15 +107,7 @@ declare const actions: {
147
107
  type: import("@awell-health/extensions-core").FieldType.STRING;
148
108
  required: true;
149
109
  };
150
- }, {
151
- openAiApiKey: {
152
- key: string;
153
- label: string;
154
- obfuscated: true;
155
- required: true;
156
- description: string;
157
- };
158
- }, "data">;
110
+ }, Record<string, never>, "data">;
159
111
  reviewMedicationExtraction: import("@awell-health/extensions-core").Action<{
160
112
  imageUrl: {
161
113
  id: string;
@@ -171,14 +123,6 @@ declare const actions: {
171
123
  type: import("@awell-health/extensions-core").FieldType.JSON;
172
124
  required: true;
173
125
  };
174
- }, {
175
- openAiApiKey: {
176
- key: string;
177
- label: string;
178
- obfuscated: true;
179
- required: true;
180
- description: string;
181
- };
182
- }, "validatedData">;
126
+ }, Record<string, never>, "validatedData">;
183
127
  };
184
128
  export default actions;
@@ -1,4 +1,3 @@
1
1
  import { type Action } from '@awell-health/extensions-core';
2
- import { type settings } from '../../settings';
3
2
  import { fields, dataPoints } from './config';
4
- export declare const medicationFromImage: Action<typeof fields, typeof settings, keyof typeof dataPoints>;
3
+ export declare const medicationFromImage: Action<typeof fields, Record<string, never>, keyof typeof dataPoints>;
@@ -1 +1 @@
1
- {"version":3,"file":"medicationFromImage.js","sourceRoot":"","sources":["../../../../../extensions/shelly/actions/medicationFromImage/medicationFromImage.ts"],"names":[],"mappings":";;;AAAA,mEAAqE;AACrE,mCAAuD;AAEvD,qCAAqE;AACrE,uCAAsD;AACtD,iFAAiE;AAEpD,QAAA,mBAAmB,GAI5B;IACF,GAAG,EAAE,qBAAqB;IAC1B,QAAQ,EAAE,0BAAQ,CAAC,QAAQ;IAC3B,KAAK,EAAE,+BAA+B;IACtC,WAAW,EAAE,oDAAoD;IACjE,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,EACJ,MAAM,EAAE,EAAE,QAAQ,EAAE,EACpB,OAAO,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,EAC1B,QAAQ,EAAE,EAAE,EAAE,EAAE,UAAU,EAAE,GAC7B,GAAG,MAAM,IAAA,iCAA2B,EAAC;YACpC,YAAY,EAAE,+BAAsB;YACpC,OAAO;SACR,CAAC,CAAA;QAEF,IAAI,CAAC;YACH,MAAM,sBAAsB,GAAG,IAAI,4BAAsB,EAAE,CAAA;YAE3D,MAAM,IAAI,GAAG,MAAM,sBAAsB,CAAC,0BAA0B,CAAC;gBACnE,QAAQ;gBACR,OAAO,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE;aACnC,CAAC,CAAA;YAEF,MAAM,UAAU,CAAC;gBACf,WAAW,EAAE;oBACX,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;wBACnB,WAAW,EAAE,IAAI,CAAC,WAAW;qBAC9B,CAAC;iBACH;aACF,CAAC,CAAA;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,KAAK,YAAY,mCAAU,EAAE,CAAC;gBAChC,MAAM,OAAO,CAAC;oBACZ,MAAM,EAAE;wBACN;4BACE,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;4BAC9B,IAAI,EAAE;gCACJ,EAAE,EAAE,GAAG,KAAK,CAAC,UAAU,KAAK,KAAK,CAAC,UAAU,MAAM,KAAK,CAAC,YAAY,EAAE;6BACvE;4BACD,KAAK,EAAE;gCACL,QAAQ,EAAE,cAAc;gCACxB,OAAO,EAAE,GAAG,KAAK,CAAC,UAAU,KAAK,KAAK,CAAC,UAAU,MAAM,KAAK,CAAC,YAAY,EAAE;6BAC5E;yBACF;qBACF;iBACF,CAAC,CAAA;gBACF,OAAM;YACR,CAAC;YAED,gDAAgD;YAChD,MAAM,KAAK,CAAA;QACb,CAAC;IACH,CAAC;CACF,CAAA"}
1
+ {"version":3,"file":"medicationFromImage.js","sourceRoot":"","sources":["../../../../../extensions/shelly/actions/medicationFromImage/medicationFromImage.ts"],"names":[],"mappings":";;;AAAA,mEAAqE;AACrE,mCAAuD;AACvD,qCAAqE;AACrE,uCAAsD;AACtD,iFAAiE;AAEpD,QAAA,mBAAmB,GAI5B;IACF,GAAG,EAAE,qBAAqB;IAC1B,QAAQ,EAAE,0BAAQ,CAAC,QAAQ;IAC3B,KAAK,EAAE,+BAA+B;IACtC,WAAW,EAAE,oDAAoD;IACjE,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,EACJ,MAAM,EAAE,EAAE,QAAQ,EAAE,EACpB,OAAO,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,EAC1B,QAAQ,EAAE,EAAE,EAAE,EAAE,UAAU,EAAE,GAC7B,GAAG,MAAM,IAAA,iCAA2B,EAAC;YACpC,YAAY,EAAE,+BAAsB;YACpC,OAAO;SACR,CAAC,CAAA;QAEF,IAAI,CAAC;YACH,MAAM,sBAAsB,GAAG,IAAI,4BAAsB,EAAE,CAAA;YAE3D,MAAM,IAAI,GAAG,MAAM,sBAAsB,CAAC,0BAA0B,CAAC;gBACnE,QAAQ;gBACR,OAAO,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE;aACnC,CAAC,CAAA;YAEF,MAAM,UAAU,CAAC;gBACf,WAAW,EAAE;oBACX,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;wBACnB,WAAW,EAAE,IAAI,CAAC,WAAW;qBAC9B,CAAC;iBACH;aACF,CAAC,CAAA;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,KAAK,YAAY,mCAAU,EAAE,CAAC;gBAChC,MAAM,OAAO,CAAC;oBACZ,MAAM,EAAE;wBACN;4BACE,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;4BAC9B,IAAI,EAAE;gCACJ,EAAE,EAAE,GAAG,KAAK,CAAC,UAAU,KAAK,KAAK,CAAC,UAAU,MAAM,KAAK,CAAC,YAAY,EAAE;6BACvE;4BACD,KAAK,EAAE;gCACL,QAAQ,EAAE,cAAc;gCACxB,OAAO,EAAE,GAAG,KAAK,CAAC,UAAU,KAAK,KAAK,CAAC,UAAU,MAAM,KAAK,CAAC,YAAY,EAAE;6BAC5E;yBACF;qBACF;iBACF,CAAC,CAAA;gBACF,OAAM;YACR,CAAC;YAED,gDAAgD;YAChD,MAAM,KAAK,CAAA;QACb,CAAC;IACH,CAAC;CACF,CAAA"}
@@ -1,4 +1,3 @@
1
1
  import { type Action } from '@awell-health/extensions-core';
2
- import { type settings } from '../../settings';
3
2
  import { fields, dataPoints } from './config';
4
- export declare const reviewMedicationExtraction: Action<typeof fields, typeof settings, keyof typeof dataPoints>;
3
+ export declare const reviewMedicationExtraction: Action<typeof fields, Record<string, never>, keyof typeof dataPoints>;
@@ -1 +1 @@
1
- {"version":3,"file":"reviewMedicationExtraction.js","sourceRoot":"","sources":["../../../../../extensions/shelly/actions/reviewMedicationExtraction/reviewMedicationExtraction.ts"],"names":[],"mappings":";;;AAAA,qDAAqD;AACrD,mEAAqE;AACrE,mCAAuD;AAEvD,qCAAqE;AAExD,QAAA,0BAA0B,GAInC;IACF,GAAG,EAAE,4BAA4B;IACjC,QAAQ,EAAE,0BAAQ,CAAC,QAAQ;IAC3B,KAAK,EAAE,8BAA8B;IACrC,WAAW,EAAE,yDAAyD;IACtE,MAAM,EAAN,eAAM;IACN,WAAW,EAAE,KAAK;IAClB,UAAU,EAAV,mBAAU;IACV,OAAO,EAAE;QACP,YAAY,EAAE;YACZ,KAAK,EAAE,aAAa;YACpB,IAAI,EAAE,QAAQ;SACf;KACF;IACD,OAAO,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,EAAiB,EAAE;QAC1E,MAAM,IAAA,iCAA2B,EAAC;YAChC,YAAY,EAAE,+BAAsB;YACpC,OAAO;SACR,CAAC,CAAA;QAEF,6BAA6B;IAC/B,CAAC;CACF,CAAA"}
1
+ {"version":3,"file":"reviewMedicationExtraction.js","sourceRoot":"","sources":["../../../../../extensions/shelly/actions/reviewMedicationExtraction/reviewMedicationExtraction.ts"],"names":[],"mappings":";;;AAAA,qDAAqD;AACrD,mEAAqE;AACrE,mCAAuD;AACvD,qCAAqE;AAExD,QAAA,0BAA0B,GAInC;IACF,GAAG,EAAE,4BAA4B;IACjC,QAAQ,EAAE,0BAAQ,CAAC,QAAQ;IAC3B,KAAK,EAAE,8BAA8B;IACrC,WAAW,EAAE,yDAAyD;IACtE,MAAM,EAAN,eAAM;IACN,WAAW,EAAE,KAAK;IAClB,UAAU,EAAV,mBAAU;IACV,OAAO,EAAE;QACP,YAAY,EAAE;YACZ,KAAK,EAAE,aAAa;YACpB,IAAI,EAAE,QAAQ;SACf;KACF;IACD,OAAO,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,EAAiB,EAAE;QAC1E,MAAM,IAAA,iCAA2B,EAAC;YAChC,YAAY,EAAE,+BAAsB;YACpC,OAAO;SACR,CAAC,CAAA;QAEF,6BAA6B;IAC/B,CAAC;CACF,CAAA"}
@@ -39,4 +39,4 @@ exports.systemPrompt = prompts_1.ChatPromptTemplate.fromTemplate(`
39
39
  Content to summarize:
40
40
  {input}
41
41
  `);
42
- //# sourceMappingURL=constants.js.map
42
+ //# sourceMappingURL=prompt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../../../../../../extensions/shelly/actions/summarizeCareFlow/lib/summarizeCareFlowWithLLM/prompt.ts"],"names":[],"mappings":";;;AAAA,qDAA4D;AAE5D,gDAAgD;AACnC,QAAA,YAAY,GAAG,4BAAkB,CAAC,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmC3D,CAAC,CAAA"}
@@ -1,7 +1,27 @@
1
1
  import { type ChatOpenAI } from '@langchain/openai';
2
- export declare const summarizeCareFlowWithLLM: ({ ChatModelGPT4o, careFlowActivities, stakeholder, additionalInstructions, }: {
3
- ChatModelGPT4o: ChatOpenAI;
2
+ import { type AIActionMetadata } from '../../../../../../src/lib/llm/openai/types';
3
+ import type { BaseCallbackHandler } from "@langchain/core/callbacks/base";
4
+ /**
5
+ * Uses LLM to summarize care flow activities.
6
+ * The function follows these steps:
7
+ * 1. Formats prompt with stakeholder context and instructions
8
+ * 2. Runs LLM to generate summary
9
+ * 3. Returns formatted summary
10
+ *
11
+ * @example
12
+ * const summary = await summarizeCareFlowWithLLM({
13
+ * model,
14
+ * careFlowActivities: "...",
15
+ * stakeholder: "Patient",
16
+ * additionalInstructions: "Focus on medications",
17
+ * metadata: { ... }
18
+ * })
19
+ */
20
+ export declare const summarizeCareFlowWithLLM: ({ model, careFlowActivities, stakeholder, additionalInstructions, metadata, callbacks, }: {
21
+ model: ChatOpenAI;
4
22
  careFlowActivities: string;
5
23
  stakeholder: string;
6
24
  additionalInstructions: string;
25
+ metadata: AIActionMetadata;
26
+ callbacks?: BaseCallbackHandler[];
7
27
  }) => Promise<string>;
@@ -1,18 +1,40 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.summarizeCareFlowWithLLM = void 0;
4
- const constants_1 = require("./constants");
5
- // TODO: remove console logs eventually
6
- const summarizeCareFlowWithLLM = async ({ ChatModelGPT4o, careFlowActivities, stakeholder, additionalInstructions, }) => {
7
- const prompt = await constants_1.systemPrompt.format({
4
+ const prompt_1 = require("./prompt");
5
+ /**
6
+ * Uses LLM to summarize care flow activities.
7
+ * The function follows these steps:
8
+ * 1. Formats prompt with stakeholder context and instructions
9
+ * 2. Runs LLM to generate summary
10
+ * 3. Returns formatted summary
11
+ *
12
+ * @example
13
+ * const summary = await summarizeCareFlowWithLLM({
14
+ * model,
15
+ * careFlowActivities: "...",
16
+ * stakeholder: "Patient",
17
+ * additionalInstructions: "Focus on medications",
18
+ * metadata: { ... }
19
+ * })
20
+ */
21
+ const summarizeCareFlowWithLLM = async ({ model, careFlowActivities, stakeholder, additionalInstructions, metadata, callbacks, }) => {
22
+ const prompt = await prompt_1.systemPrompt.format({
8
23
  stakeholder,
9
24
  additionalInstructions,
10
25
  input: careFlowActivities,
11
26
  });
12
- const summaryMessage = await ChatModelGPT4o.invoke(prompt);
13
- // TODO: for some reason compiler doesn't know that content is a string
14
- const summary = summaryMessage.content;
15
- return summary;
27
+ try {
28
+ const response = await model.invoke(prompt, {
29
+ metadata,
30
+ runName: 'ShellySummarizeCareFlow',
31
+ callbacks
32
+ });
33
+ return response.content;
34
+ }
35
+ catch (error) {
36
+ throw new Error('Failed to summarize the care flow due to an internal error.');
37
+ }
16
38
  };
17
39
  exports.summarizeCareFlowWithLLM = summarizeCareFlowWithLLM;
18
40
  //# sourceMappingURL=summarizeCareFlowWithLLM.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"summarizeCareFlowWithLLM.js","sourceRoot":"","sources":["../../../../../../../extensions/shelly/actions/summarizeCareFlow/lib/summarizeCareFlowWithLLM/summarizeCareFlowWithLLM.ts"],"names":[],"mappings":";;;AAAA,2CAA0C;AAG1C,uCAAuC;AAChC,MAAM,wBAAwB,GAAG,KAAK,EAAE,EAC7C,cAAc,EACd,kBAAkB,EAClB,WAAW,EACX,sBAAsB,GAMvB,EAAmB,EAAE;IACpB,MAAM,MAAM,GAAG,MAAM,wBAAY,CAAC,MAAM,CAAC;QACvC,WAAW;QACX,sBAAsB;QACtB,KAAK,EAAE,kBAAkB;KAC1B,CAAC,CAAA;IACF,MAAM,cAAc,GAAG,MAAM,cAAc,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;IAE1D,uEAAuE;IACvE,MAAM,OAAO,GAAG,cAAc,CAAC,OAAiB,CAAA;IAEhD,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA;AAtBY,QAAA,wBAAwB,4BAsBpC"}
1
+ {"version":3,"file":"summarizeCareFlowWithLLM.js","sourceRoot":"","sources":["../../../../../../../extensions/shelly/actions/summarizeCareFlow/lib/summarizeCareFlowWithLLM/summarizeCareFlowWithLLM.ts"],"names":[],"mappings":";;;AAAA,qCAAuC;AAKvC;;;;;;;;;;;;;;;GAeG;AACI,MAAM,wBAAwB,GAAG,KAAK,EAAE,EAC7C,KAAK,EACL,kBAAkB,EAClB,WAAW,EACX,sBAAsB,EACtB,QAAQ,EACR,SAAS,GAQV,EAAmB,EAAE;IACpB,MAAM,MAAM,GAAG,MAAM,qBAAY,CAAC,MAAM,CAAC;QACvC,WAAW;QACX,sBAAsB;QACtB,KAAK,EAAE,kBAAkB;KAC1B,CAAC,CAAA;IAEF,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,MAAM,CACjC,MAAM,EACN;YACE,QAAQ;YACR,OAAO,EAAE,yBAAyB;YAClC,SAAS;SACV,CACF,CAAA;QACD,OAAO,QAAQ,CAAC,OAAiB,CAAA;IACnC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CACb,6DAA6D,CAC9D,CAAA;IACH,CAAC;AACH,CAAC,CAAA;AApCY,QAAA,wBAAwB,4BAoCpC"}
@@ -1,4 +1,3 @@
1
1
  import { type Action } from '@awell-health/extensions-core';
2
- import { type settings } from '../../settings';
3
2
  import { fields, dataPoints } from './config';
4
- export declare const summarizeCareFlow: Action<typeof fields, typeof settings, keyof typeof dataPoints>;
3
+ export declare const summarizeCareFlow: Action<typeof fields, Record<string, never>, keyof typeof dataPoints>;
@@ -2,11 +2,12 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.summarizeCareFlow = void 0;
4
4
  const extensions_core_1 = require("@awell-health/extensions-core");
5
- const lib_1 = require("../../lib");
6
5
  const config_1 = require("./config");
7
6
  const constants_1 = require("../../lib/constants");
8
7
  const summarizeCareFlowWithLLM_1 = require("./lib/summarizeCareFlowWithLLM");
9
8
  const utils_1 = require("../../../../src/utils");
9
+ const openai_1 = require("../../../../src/lib/llm/openai");
10
+ const constants_2 = require("../../../../src/lib/llm/openai/constants");
10
11
  exports.summarizeCareFlow = {
11
12
  key: 'summarizeCareFlow',
12
13
  category: extensions_core_1.Category.WORKFLOW,
@@ -16,9 +17,15 @@ exports.summarizeCareFlow = {
16
17
  previewable: false,
17
18
  dataPoints: config_1.dataPoints,
18
19
  onEvent: async ({ payload, onComplete, onError, helpers }) => {
19
- const { ChatModelGPT4o, fields: { additionalInstructions, stakeholder }, pathway, } = await (0, lib_1.validatePayloadAndCreateSdk)({
20
- fieldsSchema: config_1.FieldsValidationSchema,
20
+ // 1. Validate input fields
21
+ const { additionalInstructions, stakeholder } = config_1.FieldsValidationSchema.parse(payload.fields);
22
+ const pathway = payload.pathway;
23
+ // 2. Initialize OpenAI model with metadata
24
+ const { model, metadata, callbacks } = await (0, openai_1.createOpenAIModel)({
25
+ settings: payload.settings,
26
+ helpers,
21
27
  payload,
28
+ modelType: constants_2.OPENAI_MODELS.GPT4o
22
29
  });
23
30
  const awellSdk = await helpers.awellSdk();
24
31
  /**
@@ -57,24 +64,20 @@ exports.summarizeCareFlow = {
57
64
  },
58
65
  },
59
66
  });
60
- try {
61
- const summary = await (0, summarizeCareFlowWithLLM_1.summarizeCareFlowWithLLM)({
62
- ChatModelGPT4o,
63
- careFlowActivities: JSON.stringify(pathwayActivitesUntilNow.pathwayActivities.activities, null, 2),
64
- stakeholder,
65
- additionalInstructions,
66
- });
67
- const htmlSummary = await (0, utils_1.markdownToHtml)(`${constants_1.DISCLAIMER_MSG}\n\n${summary}`);
68
- await onComplete({
69
- data_points: {
70
- summary: htmlSummary,
71
- },
72
- });
73
- }
74
- catch (error) {
75
- console.error('Error summarizing care flow:', error);
76
- throw new Error('Error summarizing care flow');
77
- }
67
+ const summary = await (0, summarizeCareFlowWithLLM_1.summarizeCareFlowWithLLM)({
68
+ model,
69
+ careFlowActivities: JSON.stringify(pathwayActivitesUntilNow.pathwayActivities.activities, null, 2),
70
+ stakeholder,
71
+ additionalInstructions,
72
+ metadata,
73
+ callbacks
74
+ });
75
+ const htmlSummary = await (0, utils_1.markdownToHtml)(`${constants_1.DISCLAIMER_MSG}\n\n${summary}`);
76
+ await onComplete({
77
+ data_points: {
78
+ summary: htmlSummary,
79
+ },
80
+ });
78
81
  },
79
82
  };
80
83
  //# sourceMappingURL=summarizeCareFlow.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"summarizeCareFlow.js","sourceRoot":"","sources":["../../../../../extensions/shelly/actions/summarizeCareFlow/summarizeCareFlow.ts"],"names":[],"mappings":";;;AAAA,mEAAqE;AACrE,mCAAuD;AAEvD,qCAAqE;AACrE,mDAAoD;AACpD,6EAAyE;AACzE,iDAAsD;AAEzC,QAAA,iBAAiB,GAI1B;IACF,GAAG,EAAE,mBAAmB;IACxB,QAAQ,EAAE,0BAAQ,CAAC,QAAQ;IAC3B,KAAK,EAAE,qBAAqB;IAC5B,WAAW,EAAE,sCAAsC;IACnD,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,EACJ,cAAc,EACd,MAAM,EAAE,EAAE,sBAAsB,EAAE,WAAW,EAAE,EAC/C,OAAO,GACR,GAAG,MAAM,IAAA,iCAA2B,EAAC;YACpC,YAAY,EAAE,+BAAsB;YACpC,OAAO;SACR,CAAC,CAAA;QAEF,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,QAAQ,EAAE,CAAA;QAEzC;;WAEG;QACH,MAAM,wBAAwB,GAAG,MAAM,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC;YAClE,iBAAiB,EAAE;gBACjB,MAAM,EAAE;oBACN,UAAU,EAAE,OAAO,CAAC,EAAE;oBACtB,UAAU,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE;oBACrC,OAAO,EAAE;wBACP,SAAS,EAAE,MAAM;wBACjB,KAAK,EAAE,MAAM;qBACd;iBACF;gBACD,UAAU,EAAE;oBACV,QAAQ,EAAE,IAAI;oBACd,OAAO,EAAE;wBACP,QAAQ,EAAE,IAAI;qBACf;oBACD,MAAM,EAAE;wBACN,QAAQ,EAAE,IAAI;qBACf;oBACD,eAAe,EAAE;wBACf,QAAQ,EAAE,IAAI;qBACf;oBACD,OAAO,EAAE;wBACP,QAAQ,EAAE,IAAI;qBACf;oBACD,KAAK,EAAE;wBACL,QAAQ,EAAE,IAAI;qBACf;oBACD,cAAc,EAAE;wBACd,QAAQ,EAAE,IAAI;qBACf;iBACF;aACF;SACF,CAAC,CAAA;QAEF,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,MAAM,IAAA,mDAAwB,EAAC;gBAC7C,cAAc;gBACd,kBAAkB,EAAE,IAAI,CAAC,SAAS,CAChC,wBAAwB,CAAC,iBAAiB,CAAC,UAAU,EACrD,IAAI,EACJ,CAAC,CACF;gBACD,WAAW;gBACX,sBAAsB;aACvB,CAAC,CAAA;YAEF,MAAM,WAAW,GAAG,MAAM,IAAA,sBAAc,EACtC,GAAG,0BAAc,OAAO,OAAO,EAAE,CAClC,CAAA;YAED,MAAM,UAAU,CAAC;gBACf,WAAW,EAAE;oBACX,OAAO,EAAE,WAAW;iBACrB;aACF,CAAC,CAAA;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,8BAA8B,EAAE,KAAK,CAAC,CAAA;YACpD,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAA;QAChD,CAAC;IACH,CAAC;CACF,CAAA"}
1
+ {"version":3,"file":"summarizeCareFlow.js","sourceRoot":"","sources":["../../../../../extensions/shelly/actions/summarizeCareFlow/summarizeCareFlow.ts"],"names":[],"mappings":";;;AAAA,mEAAqE;AACrE,qCAAqE;AACrE,mDAAoD;AACpD,6EAAyE;AACzE,iDAAsD;AACtD,2DAAkE;AAClE,wEAAwE;AAE3D,QAAA,iBAAiB,GAI1B;IACF,GAAG,EAAE,mBAAmB;IACxB,QAAQ,EAAE,0BAAQ,CAAC,QAAQ;IAC3B,KAAK,EAAE,qBAAqB;IAC5B,WAAW,EAAE,sCAAsC;IACnD,MAAM,EAAN,eAAM;IACN,WAAW,EAAE,KAAK;IAClB,UAAU,EAAV,mBAAU;IAEV,OAAO,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,EAAiB,EAAE;QAC1E,2BAA2B;QAC3B,MAAM,EAAE,sBAAsB,EAAE,WAAW,EAAE,GAAG,+BAAsB,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;QAC5F,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAA;QAE/B,2CAA2C;QAC3C,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,MAAM,IAAA,0BAAiB,EAAC;YAC7D,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,OAAO;YACP,OAAO;YACP,SAAS,EAAE,yBAAa,CAAC,KAAK;SAC/B,CAAC,CAAA;QAEF,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,QAAQ,EAAE,CAAA;QAEzC;;WAEG;QACH,MAAM,wBAAwB,GAAG,MAAM,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC;YAClE,iBAAiB,EAAE;gBACjB,MAAM,EAAE;oBACN,UAAU,EAAE,OAAO,CAAC,EAAE;oBACtB,UAAU,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE;oBACrC,OAAO,EAAE;wBACP,SAAS,EAAE,MAAM;wBACjB,KAAK,EAAE,MAAM;qBACd;iBACF;gBACD,UAAU,EAAE;oBACV,QAAQ,EAAE,IAAI;oBACd,OAAO,EAAE;wBACP,QAAQ,EAAE,IAAI;qBACf;oBACD,MAAM,EAAE;wBACN,QAAQ,EAAE,IAAI;qBACf;oBACD,eAAe,EAAE;wBACf,QAAQ,EAAE,IAAI;qBACf;oBACD,OAAO,EAAE;wBACP,QAAQ,EAAE,IAAI;qBACf;oBACD,KAAK,EAAE;wBACL,QAAQ,EAAE,IAAI;qBACf;oBACD,cAAc,EAAE;wBACd,QAAQ,EAAE,IAAI;qBACf;iBACF;aACF;SACF,CAAC,CAAA;QAEF,MAAM,OAAO,GAAG,MAAM,IAAA,mDAAwB,EAAC;YAC7C,KAAK;YACL,kBAAkB,EAAE,IAAI,CAAC,SAAS,CAChC,wBAAwB,CAAC,iBAAiB,CAAC,UAAU,EACrD,IAAI,EACJ,CAAC,CACF;YACD,WAAW;YACX,sBAAsB;YACtB,QAAQ;YACR,SAAS;SACV,CAAC,CAAA;QAEF,MAAM,WAAW,GAAG,MAAM,IAAA,sBAAc,EACtC,GAAG,0BAAc,OAAO,OAAO,EAAE,CAClC,CAAA;QAED,MAAM,UAAU,CAAC;YACf,WAAW,EAAE;gBACX,OAAO,EAAE,WAAW;aACrB;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA"}
@@ -1,4 +1,12 @@
1
1
  import { type Action } from '@awell-health/extensions-core';
2
- import { type settings } from '../../settings';
3
2
  import { fields, dataPoints } from './config';
4
- export declare const summarizeForm: Action<typeof fields, typeof settings, keyof typeof dataPoints>;
3
+ /**
4
+ * Awell Action: Form Summarization
5
+ *
6
+ * Takes form responses and preferences as input, uses LLM to:
7
+ * 1. Generate a concise summary in specified format and language
8
+ * 2. Includes appropriate disclaimer
9
+ *
10
+ * @returns HTML-formatted summary
11
+ */
12
+ export declare const summarizeForm: Action<typeof fields, Record<string, never>, keyof typeof dataPoints>;
@@ -2,14 +2,23 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.summarizeForm = void 0;
4
4
  const extensions_core_1 = require("@awell-health/extensions-core");
5
- const lib_1 = require("../../lib");
5
+ const summarizeFormWithLLM_1 = require("../../lib/summarizeFormWithLLM");
6
+ const createOpenAIModel_1 = require("../../../../src/lib/llm/openai/createOpenAIModel");
7
+ const constants_1 = require("../../../../src/lib/llm/openai/constants");
6
8
  const config_1 = require("./config");
7
9
  const getFormResponseText_1 = require("../../lib/getFormResponseText");
8
- const summarizeFormWithLLM_1 = require("../../lib/summarizeFormWithLLM");
9
- const constants_1 = require("../../lib/constants");
10
10
  const awell_1 = require("../../../../src/lib/awell");
11
11
  const utils_1 = require("../../../../src/utils");
12
- // TODO: get rid of the console logs eventually
12
+ const constants_2 = require("../../lib/constants");
13
+ /**
14
+ * Awell Action: Form Summarization
15
+ *
16
+ * Takes form responses and preferences as input, uses LLM to:
17
+ * 1. Generate a concise summary in specified format and language
18
+ * 2. Includes appropriate disclaimer
19
+ *
20
+ * @returns HTML-formatted summary
21
+ */
13
22
  exports.summarizeForm = {
14
23
  key: 'summarizeForm',
15
24
  category: extensions_core_1.Category.WORKFLOW,
@@ -19,38 +28,43 @@ exports.summarizeForm = {
19
28
  previewable: false,
20
29
  dataPoints: config_1.dataPoints,
21
30
  onEvent: async ({ payload, onComplete, onError, helpers }) => {
22
- const { ChatModelGPT4o, fields: { summaryFormat, language }, pathway, activity, } = await (0, lib_1.validatePayloadAndCreateSdk)({
23
- fieldsSchema: config_1.FieldsValidationSchema,
31
+ // 1. Validate input fields
32
+ const { summaryFormat, language } = config_1.FieldsValidationSchema.parse(payload.fields);
33
+ // 2. Initialize OpenAI model with metadata
34
+ const { model, metadata, callbacks } = await (0, createOpenAIModel_1.createOpenAIModel)({
35
+ settings: payload.settings,
36
+ helpers,
24
37
  payload,
38
+ modelType: constants_1.OPENAI_MODELS.GPT4o,
39
+ hideDataForTracing: true // Hide input and output data when tracing
25
40
  });
41
+ // 3. Get form data
26
42
  const { formDefinition, formResponse } = await (0, awell_1.getLatestFormInCurrentStep)({
27
43
  awellSdk: await helpers.awellSdk(),
28
- pathwayId: pathway.id,
29
- activityId: activity.id,
44
+ pathwayId: payload.pathway.id,
45
+ activityId: payload.activity.id,
30
46
  });
31
- const { result: responseText } = (0, getFormResponseText_1.getFormResponseText)({
47
+ const { result: formData } = (0, getFormResponseText_1.getFormResponseText)({
32
48
  formDefinition,
33
49
  formResponse,
34
50
  });
35
- try {
36
- const summary = await (0, summarizeFormWithLLM_1.summarizeFormWithLLM)({
37
- ChatModelGPT4o,
38
- formData: responseText,
39
- summaryFormat,
40
- language,
41
- disclaimerMessage: constants_1.DISCLAIMER_MSG_FORM,
42
- });
43
- const htmlSummary = await (0, utils_1.markdownToHtml)(summary);
44
- await onComplete({
45
- data_points: {
46
- summary: htmlSummary,
47
- },
48
- });
49
- }
50
- catch (error) {
51
- console.error('Error summarizing form:', error);
52
- throw new Error('Error summarizing form');
53
- }
51
+ // 4. Generate summary
52
+ const summary = await (0, summarizeFormWithLLM_1.summarizeFormWithLLM)({
53
+ model,
54
+ formData,
55
+ summaryFormat,
56
+ language,
57
+ disclaimerMessage: constants_2.DISCLAIMER_MSG_FORM,
58
+ metadata,
59
+ callbacks
60
+ });
61
+ // 5. Format and return results
62
+ const htmlSummary = await (0, utils_1.markdownToHtml)(summary);
63
+ await onComplete({
64
+ data_points: {
65
+ summary: htmlSummary,
66
+ },
67
+ });
54
68
  },
55
69
  };
56
70
  //# sourceMappingURL=summarizeForm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"summarizeForm.js","sourceRoot":"","sources":["../../../../../extensions/shelly/actions/summarizeForm/summarizeForm.ts"],"names":[],"mappings":";;;AAAA,mEAAqE;AACrE,mCAAuD;AAEvD,qCAAqE;AACrE,uEAAmE;AACnE,yEAAqE;AACrE,mDAAyD;AACzD,qDAAsE;AACtE,iDAAsD;AAEtD,+CAA+C;AAClC,QAAA,aAAa,GAItB;IACF,GAAG,EAAE,eAAe;IACpB,QAAQ,EAAE,0BAAQ,CAAC,QAAQ;IAC3B,KAAK,EAAE,gBAAgB;IACvB,WAAW,EAAE,0DAA0D;IACvE,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,EACJ,cAAc,EACd,MAAM,EAAE,EAAE,aAAa,EAAE,QAAQ,EAAE,EACnC,OAAO,EACP,QAAQ,GACT,GAAG,MAAM,IAAA,iCAA2B,EAAC;YACpC,YAAY,EAAE,+BAAsB;YACpC,OAAO;SACR,CAAC,CAAA;QAEF,MAAM,EAAE,cAAc,EAAE,YAAY,EAAE,GAAG,MAAM,IAAA,kCAA0B,EAAC;YACxE,QAAQ,EAAE,MAAM,OAAO,CAAC,QAAQ,EAAE;YAClC,SAAS,EAAE,OAAO,CAAC,EAAE;YACrB,UAAU,EAAE,QAAQ,CAAC,EAAE;SACxB,CAAC,CAAA;QAEF,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,GAAG,IAAA,yCAAmB,EAAC;YACnD,cAAc;YACd,YAAY;SACb,CAAC,CAAA;QAEF,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,MAAM,IAAA,2CAAoB,EAAC;gBACzC,cAAc;gBACd,QAAQ,EAAE,YAAY;gBACtB,aAAa;gBACb,QAAQ;gBACR,iBAAiB,EAAE,+BAAmB;aACvC,CAAC,CAAA;YAEF,MAAM,WAAW,GAAG,MAAM,IAAA,sBAAc,EAAC,OAAO,CAAC,CAAA;YAGjD,MAAM,UAAU,CAAC;gBACf,WAAW,EAAE;oBACX,OAAO,EAAE,WAAW;iBACrB;aACF,CAAC,CAAA;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,yBAAyB,EAAE,KAAK,CAAC,CAAA;YAC/C,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAA;QAC3C,CAAC;IACH,CAAC;CACF,CAAA"}
1
+ {"version":3,"file":"summarizeForm.js","sourceRoot":"","sources":["../../../../../extensions/shelly/actions/summarizeForm/summarizeForm.ts"],"names":[],"mappings":";;;AAAA,mEAAqE;AACrE,yEAAqE;AACrE,wFAAoF;AACpF,wEAAwE;AACxE,qCAAqE;AACrE,uEAAmE;AACnE,qDAAsE;AACtE,iDAAsD;AACtD,mDAAyD;AAEzD;;;;;;;;GAQG;AACU,QAAA,aAAa,GAItB;IACF,GAAG,EAAE,eAAe;IACpB,QAAQ,EAAE,0BAAQ,CAAC,QAAQ;IAC3B,KAAK,EAAE,gBAAgB;IACvB,WAAW,EAAE,0DAA0D;IACvE,MAAM,EAAN,eAAM;IACN,WAAW,EAAE,KAAK;IAClB,UAAU,EAAV,mBAAU;IAEV,OAAO,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,EAAiB,EAAE;QAC1E,2BAA2B;QAC3B,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,GAAG,+BAAsB,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;QAEhF,2CAA2C;QAC3C,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,MAAM,IAAA,qCAAiB,EAAC;YAC7D,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,OAAO;YACP,OAAO;YACP,SAAS,EAAE,yBAAa,CAAC,KAAK;YAC9B,kBAAkB,EAAE,IAAI,CAAC,0CAA0C;SACpE,CAAC,CAAA;QAEF,mBAAmB;QACnB,MAAM,EAAE,cAAc,EAAE,YAAY,EAAE,GAAG,MAAM,IAAA,kCAA0B,EAAC;YACxE,QAAQ,EAAE,MAAM,OAAO,CAAC,QAAQ,EAAE;YAClC,SAAS,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE;YAC7B,UAAU,EAAE,OAAO,CAAC,QAAQ,CAAC,EAAE;SAChC,CAAC,CAAA;QAEF,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAA,yCAAmB,EAAC;YAC/C,cAAc;YACd,YAAY;SACb,CAAC,CAAA;QAEF,sBAAsB;QACtB,MAAM,OAAO,GAAG,MAAM,IAAA,2CAAoB,EAAC;YACzC,KAAK;YACL,QAAQ;YACR,aAAa;YACb,QAAQ;YACR,iBAAiB,EAAE,+BAAmB;YACtC,QAAQ;YACR,SAAS;SACV,CAAC,CAAA;QAEF,+BAA+B;QAC/B,MAAM,WAAW,GAAG,MAAM,IAAA,sBAAc,EAAC,OAAO,CAAC,CAAA;QACjD,MAAM,UAAU,CAAC;YACf,WAAW,EAAE;gBACX,OAAO,EAAE,WAAW;aACrB;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA"}
@@ -1,4 +1,3 @@
1
1
  import { type Action } from '@awell-health/extensions-core';
2
- import { type settings } from '../../settings';
3
2
  import { fields, dataPoints } from './config';
4
- export declare const summarizeFormsInStep: Action<typeof fields, typeof settings, keyof typeof dataPoints>;
3
+ export declare const summarizeFormsInStep: Action<typeof fields, Record<string, never>, keyof typeof dataPoints>;