Skip to content

Commit

Permalink
Merge branch 'main' into cerner_progress
Browse files Browse the repository at this point in the history
  • Loading branch information
nckhell committed Feb 6, 2025
2 parents bb7f7c3 + 6fb2200 commit f416d34
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ describe('createMessageThread action', () => {
patientId: 123456,
practiceId: 654321,
senderId: 7891011,
documentDate: '2025-02-04T08:21:43Z',
chartDate: '2025-02-04T08:21:43Z',
isUrgent: true,
documentDate: undefined,
chartDate: undefined,
isUrgent: undefined,
messageBody: 'Initial message in the thread',
recipientId: 123456,
groupId: 654321,
recipientId: undefined,
groupId: undefined,
}

const validSettings = {
Expand Down Expand Up @@ -71,16 +71,11 @@ describe('createMessageThread action', () => {

describe('validation errors', () => {
it('should set default documentDate and chartDate if not provided', async () => {
const fields = {
...validFields,
documentDate: undefined,
chartDate: undefined,
}

const validatedFields = FieldsValidationSchema.parse(fields)
const validatedFields = FieldsValidationSchema.parse(validFields)

expect(validatedFields.documentDate).not.toBeUndefined()
expect(validatedFields.chartDate).not.toBeUndefined()
expect(validatedFields.isUrgent).toBe(false)
})

it.each([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { type settings } from '../../settings'
import { makeAPIClient } from '../../client'
import { messageThreadSchema } from '../../validation/messageThread.zod'
import { isNil } from 'lodash'
import { dataPoints, fields } from './config'
import { dataPoints, fields, FieldsValidationSchema } from './config'

export const createMessageThread: Action<
typeof fields,
Expand All @@ -29,7 +29,7 @@ export const createMessageThread: Action<
isUrgent,
recipientId,
groupId,
} = payload.fields
} = FieldsValidationSchema.parse(payload.fields)

const threadMembers = [
// Individual recipient
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@awell-health/awell-extensions",
"version": "2.0.174",
"version": "2.0.175",
"packageManager": "[email protected]",
"main": "dist/src/index.js",
"repository": {
Expand Down

0 comments on commit f416d34

Please sign in to comment.