vet-data-utils-ts 0.5.15 → 0.5.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -29,7 +29,7 @@ const nativeFieldsByResource = Object.freeze({
29
29
  Location: new Set(['identifier', 'status', 'mode', 'name', 'description', 'type', 'telecom', 'address', 'physicalType', 'position', 'managingOrganization', 'characteristic', 'contained']),
30
30
  Schedule: new Set(['identifier', 'active', 'serviceCategory', 'serviceType', 'specialty', 'name', 'actor', 'planningHorizon', 'comment']),
31
31
  Slot: new Set(['identifier', 'serviceCategory', 'serviceType', 'specialty', 'appointmentType', 'schedule', 'status', 'start', 'end', 'overbooked', 'comment']),
32
- Appointment: new Set(['identifier', 'status', 'serviceCategory', 'serviceType', 'specialty', 'appointmentType', 'reason', 'description', 'start', 'end', 'slot', 'participant', 'subject', 'note', 'supportingInformation']),
32
+ Appointment: new Set(['identifier', 'status', 'serviceCategory', 'serviceType', 'specialty', 'appointmentType', 'reason', 'description', 'start', 'end', 'slot', 'participant', 'subject', 'note', 'supportingInformation', 'contained']),
33
33
  AppointmentResponse: new Set(['identifier', 'appointment', 'proposedNewTime', 'start', 'end', 'participantType', 'actor', 'participantStatus', 'comment', 'recurring', 'occurrenceDate', 'recurrenceId', 'contained']),
34
34
  });
35
35
  /** Validates native FHIR scheduling data and normalizes indexed SearchParameter claims to strings. */
@@ -295,6 +295,11 @@ export function buildAppointmentResource(input) {
295
295
  const startInstant = new Date(start).toISOString();
296
296
  const endInstant = new Date(end).toISOString();
297
297
  const organization = hasOrganization ? organizationReference.trim() : undefined;
298
+ const emailEndpoint = hasNotificationEmail ? {
299
+ resourceType: 'Endpoint', id: 'clinic-notification-email', status: 'active',
300
+ connectionType: [{ coding: [{ code: 'email' }] }],
301
+ address: `mailto:${notificationEmail.trim().toLowerCase()}`,
302
+ } : undefined;
298
303
  return claimsResource('Appointment', input.id, {
299
304
  'Appointment.identifier': input.id, 'Appointment.status': input.status, 'Appointment.date': startInstant,
300
305
  ...(input.slotReferences.length ? { 'Appointment.slot': Object.freeze([...input.slotReferences]) } : {}),
@@ -306,7 +311,8 @@ export function buildAppointmentResource(input) {
306
311
  identifier: [{ value: input.id }], status: input.status, start: startInstant, end: endInstant,
307
312
  ...(input.slotReferences.length ? { slot: input.slotReferences.map(reference => ({ reference })) } : {}),
308
313
  participant: input.actorReferences.map(reference => ({ actor: { reference }, status: 'needs-action' })),
309
- ...(organization ? { supportingInformation: [{ reference: organization }] } : {}),
314
+ ...(organization ? { supportingInformation: [{ reference: organization }, { reference: '#clinic-notification-email' }] } : {}),
315
+ ...(emailEndpoint ? { contained: [emailEndpoint] } : {}),
310
316
  });
311
317
  }
312
318
  /** Builds the durable web inbox notification when a schedule change displaces an appointment. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vet-data-utils-ts",
3
- "version": "0.5.15",
3
+ "version": "0.5.16",
4
4
  "description": "Browser-safe governed VetChain data contracts",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Connecting Solution & Applications Ltd",