fhir-data-utils-ts 0.6.2 → 0.6.4
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.
- package/CHANGELOG.md +12 -0
- package/dist/appointment-communication-test-data.d.ts +2 -63
- package/dist/appointment-communication-test-data.js +2 -77
- package/dist/builders/immunization-reminders.d.ts +4 -0
- package/dist/builders/immunization-reminders.js +4 -0
- package/dist/builders/index.d.ts +0 -1
- package/dist/builders/index.js +0 -1
- package/dist/claims/task-claims.d.ts +1 -0
- package/dist/claims/task-claims.js +1 -0
- package/dist/data/appointment-communication.data.d.ts +63 -0
- package/dist/data/appointment-communication.data.js +77 -0
- package/dist/data/encounter-transfer.data.d.ts +41 -0
- package/dist/data/encounter-transfer.data.js +38 -0
- package/dist/data/index.d.ts +4 -0
- package/dist/data/index.js +4 -0
- package/dist/data/ips-all-sections.data.d.ts +327 -0
- package/dist/data/ips-all-sections.data.js +114 -0
- package/dist/encounter-transfer-test-data.d.ts +2 -41
- package/dist/encounter-transfer-test-data.js +2 -38
- package/dist/index.d.ts +1 -3
- package/dist/index.js +1 -3
- package/package.json +6 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
- Export one repository-safe, telephone-free IPS demo document with all sixteen
|
|
6
|
+
clinical sections from the explicit `fhir-data-utils-ts/data` entry point so
|
|
7
|
+
product portals and visual tests share the same typed source data.
|
|
8
|
+
- Publish repository-safe Appointment/Communication and Encounter-transfer
|
|
9
|
+
fixtures from the explicit `fhir-data-utils-ts/data` entry point. Their
|
|
10
|
+
`*.data.ts` implementations are excluded from executable coverage while the
|
|
11
|
+
historical source modules remain compatibility reexports.
|
|
12
|
+
- Remove notification-channel policy from the general root and `builders`
|
|
13
|
+
surfaces. The historical reminder subpath and non-standard `Task.channel`
|
|
14
|
+
claim remain deprecated compatibility only while product packages migrate;
|
|
15
|
+
SOS/Vet/UHC own channel choices and dispatch behavior.
|
|
16
|
+
|
|
5
17
|
## 0.6.2 - 2026-09-30
|
|
6
18
|
|
|
7
19
|
- Add strict FHIR `instant` to Unix epoch-second derivation while preserving
|
|
@@ -1,63 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export declare const FHIR_APPOINTMENT_COMMUNICATION_TEST_DATA: Readonly<{
|
|
4
|
-
release: "r5";
|
|
5
|
-
start: "2026-10-05T16:00:00.000Z";
|
|
6
|
-
end: "2026-10-05T16:30:00.000Z";
|
|
7
|
-
communicationId: "communication-one";
|
|
8
|
-
subjectReference: "Patient/animal-one";
|
|
9
|
-
senderReference: "Organization/clinic-one";
|
|
10
|
-
recipientReference: "RelatedPerson/controller-one";
|
|
11
|
-
appointmentReference: "Appointment/appointment-one";
|
|
12
|
-
calendarData: string;
|
|
13
|
-
appointment: Readonly<{
|
|
14
|
-
[key: string]: unknown;
|
|
15
|
-
resourceType: string;
|
|
16
|
-
id?: string;
|
|
17
|
-
language?: string;
|
|
18
|
-
meta?: Readonly<Record<string, unknown>>;
|
|
19
|
-
contained?: readonly FhirResource[];
|
|
20
|
-
}>;
|
|
21
|
-
calendarDocument: Readonly<{
|
|
22
|
-
[key: string]: unknown;
|
|
23
|
-
resourceType: string;
|
|
24
|
-
id?: string;
|
|
25
|
-
language?: string;
|
|
26
|
-
meta?: Readonly<Record<string, unknown>>;
|
|
27
|
-
contained?: readonly FhirResource[];
|
|
28
|
-
}>;
|
|
29
|
-
communication: Readonly<{
|
|
30
|
-
[key: string]: unknown;
|
|
31
|
-
resourceType: string;
|
|
32
|
-
id?: string;
|
|
33
|
-
language?: string;
|
|
34
|
-
meta?: Readonly<Record<string, unknown>>;
|
|
35
|
-
contained?: readonly FhirResource[];
|
|
36
|
-
}>;
|
|
37
|
-
outerBatch: FhirBundle;
|
|
38
|
-
outerBatchWithInvalidDocument: FhirBundle;
|
|
39
|
-
outerBatchWithInvalidInnerBatch: FhirBundle;
|
|
40
|
-
outerBatchWithBareAppointment: Readonly<{
|
|
41
|
-
resourceType: "Bundle";
|
|
42
|
-
type: "batch";
|
|
43
|
-
entry: {
|
|
44
|
-
resource: {
|
|
45
|
-
payload: {
|
|
46
|
-
contentAttachment: {
|
|
47
|
-
contentType: string;
|
|
48
|
-
data: string;
|
|
49
|
-
};
|
|
50
|
-
}[];
|
|
51
|
-
resourceType: string;
|
|
52
|
-
id?: string;
|
|
53
|
-
language?: string;
|
|
54
|
-
meta?: Readonly<Record<string, unknown>>;
|
|
55
|
-
contained?: readonly FhirResource[];
|
|
56
|
-
};
|
|
57
|
-
request: {
|
|
58
|
-
method: string;
|
|
59
|
-
url: string;
|
|
60
|
-
};
|
|
61
|
-
}[];
|
|
62
|
-
}>;
|
|
63
|
-
}>;
|
|
1
|
+
/** @deprecated Import reusable fixtures from `fhir-data-utils-ts/data`. */
|
|
2
|
+
export * from './data/appointment-communication.data.js';
|
|
@@ -1,77 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const CALENDAR_DOCUMENT_ID = 'appointment-calendar-one';
|
|
4
|
-
const SUBJECT_REFERENCE = 'Patient/animal-one';
|
|
5
|
-
const SENDER_REFERENCE = 'Organization/clinic-one';
|
|
6
|
-
const RECIPIENT_REFERENCE = 'RelatedPerson/controller-one';
|
|
7
|
-
const APPOINTMENT_REFERENCE = `Appointment/${APPOINTMENT_ID}`;
|
|
8
|
-
const CALENDAR_DOCUMENT_REFERENCE = `DocumentReference/${CALENDAR_DOCUMENT_ID}`;
|
|
9
|
-
const APPOINTMENT_START = '2026-10-05T16:00:00.000Z';
|
|
10
|
-
const APPOINTMENT_END = '2026-10-05T16:30:00.000Z';
|
|
11
|
-
const CALENDAR_DATA = encodeBase64Utf8('BEGIN:VCALENDAR\r\nVERSION:2.0\r\nBEGIN:VEVENT\r\nDTSTART:20261005T160000Z\r\nDTEND:20261005T163000Z\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n');
|
|
12
|
-
const APPOINTMENT = Object.freeze({
|
|
13
|
-
resourceType: 'Appointment', id: APPOINTMENT_ID, identifier: [{ value: APPOINTMENT_ID }], status: 'booked',
|
|
14
|
-
start: APPOINTMENT_START, end: APPOINTMENT_END,
|
|
15
|
-
participant: [{ actor: { reference: SUBJECT_REFERENCE }, status: 'accepted' }, { actor: { reference: 'PractitionerRole/veterinarian-one' }, status: 'accepted' }, { actor: { reference: 'Location/consultation-one' }, status: 'accepted' }],
|
|
16
|
-
slot: [{ reference: 'Slot/consultation-one' }], supportingInformation: [{ reference: CALENDAR_DOCUMENT_REFERENCE }],
|
|
17
|
-
});
|
|
18
|
-
const CALENDAR_DOCUMENT = Object.freeze({
|
|
19
|
-
resourceType: 'DocumentReference', id: CALENDAR_DOCUMENT_ID, identifier: [{ value: CALENDAR_DOCUMENT_ID }], status: 'current',
|
|
20
|
-
subject: { reference: SUBJECT_REFERENCE }, context: { related: [{ reference: APPOINTMENT_REFERENCE }] },
|
|
21
|
-
content: [{ attachment: { contentType: 'text/calendar', data: CALENDAR_DATA, title: 'appointment.ics' } }],
|
|
22
|
-
});
|
|
23
|
-
const INNER_BUNDLE = Object.freeze({ resourceType: 'Bundle', type: 'collection', entry: [{ resource: APPOINTMENT }, { resource: CALENDAR_DOCUMENT }] });
|
|
24
|
-
const COMMUNICATION = Object.freeze({
|
|
25
|
-
resourceType: 'Communication', id: COMMUNICATION_ID, identifier: [{ value: COMMUNICATION_ID }], status: 'completed',
|
|
26
|
-
subject: { reference: SUBJECT_REFERENCE }, recipient: [{ reference: RECIPIENT_REFERENCE }], sender: { reference: SENDER_REFERENCE },
|
|
27
|
-
payload: [{ contentAttachment: { contentType: 'application/fhir+json', data: encodeBase64Utf8(JSON.stringify(INNER_BUNDLE)), title: 'appointment-bundle.json' } }],
|
|
28
|
-
});
|
|
29
|
-
function communicationWithInnerBundle(innerBundle) {
|
|
30
|
-
return Object.freeze({
|
|
31
|
-
...COMMUNICATION,
|
|
32
|
-
payload: [{ contentAttachment: { contentType: 'application/fhir+json', data: encodeBase64Utf8(JSON.stringify(innerBundle)) } }],
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
function outerBatchWithCommunication(communication) {
|
|
36
|
-
return Object.freeze({
|
|
37
|
-
resourceType: 'Bundle',
|
|
38
|
-
type: 'batch',
|
|
39
|
-
entry: [{ resource: communication, request: { method: 'POST', url: 'Communication' } }],
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
/** Repository-safe reusable evidence for appointment Bundle and calendar tests. */
|
|
43
|
-
export const FHIR_APPOINTMENT_COMMUNICATION_TEST_DATA = Object.freeze({
|
|
44
|
-
release: 'r5',
|
|
45
|
-
start: APPOINTMENT_START,
|
|
46
|
-
end: APPOINTMENT_END,
|
|
47
|
-
communicationId: COMMUNICATION_ID,
|
|
48
|
-
subjectReference: SUBJECT_REFERENCE,
|
|
49
|
-
senderReference: SENDER_REFERENCE,
|
|
50
|
-
recipientReference: RECIPIENT_REFERENCE,
|
|
51
|
-
appointmentReference: APPOINTMENT_REFERENCE,
|
|
52
|
-
calendarData: CALENDAR_DATA,
|
|
53
|
-
appointment: APPOINTMENT,
|
|
54
|
-
calendarDocument: CALENDAR_DOCUMENT,
|
|
55
|
-
communication: COMMUNICATION,
|
|
56
|
-
outerBatch: outerBatchWithCommunication(COMMUNICATION),
|
|
57
|
-
outerBatchWithInvalidDocument: outerBatchWithCommunication(communicationWithInnerBundle(Object.freeze({
|
|
58
|
-
resourceType: 'Bundle',
|
|
59
|
-
type: 'document',
|
|
60
|
-
entry: [{ resource: APPOINTMENT }],
|
|
61
|
-
}))),
|
|
62
|
-
outerBatchWithInvalidInnerBatch: outerBatchWithCommunication(communicationWithInnerBundle(Object.freeze({
|
|
63
|
-
resourceType: 'Bundle',
|
|
64
|
-
type: 'batch',
|
|
65
|
-
entry: [{ resource: APPOINTMENT }],
|
|
66
|
-
}))),
|
|
67
|
-
outerBatchWithBareAppointment: Object.freeze({
|
|
68
|
-
resourceType: 'Bundle', type: 'batch', entry: [{ resource: { ...COMMUNICATION, payload: [{ contentAttachment: { contentType: 'application/fhir+json', data: encodeBase64Utf8(JSON.stringify(APPOINTMENT)) } }] }, request: { method: 'POST', url: 'Communication' } }],
|
|
69
|
-
}),
|
|
70
|
-
});
|
|
71
|
-
function encodeBase64Utf8(value) {
|
|
72
|
-
const bytes = new TextEncoder().encode(value);
|
|
73
|
-
let binary = '';
|
|
74
|
-
for (const byte of bytes)
|
|
75
|
-
binary += String.fromCharCode(byte);
|
|
76
|
-
return globalThis.btoa(binary);
|
|
77
|
-
}
|
|
1
|
+
/** @deprecated Import reusable fixtures from `fhir-data-utils-ts/data`. */
|
|
2
|
+
export * from './data/appointment-communication.data.js';
|
|
@@ -5,6 +5,10 @@ export declare const ImmunizationReminderTaskValues: Readonly<{
|
|
|
5
5
|
readonly Code: "immunization-reminder";
|
|
6
6
|
readonly TriggerType: "scheduled";
|
|
7
7
|
}>;
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated Compatibility only. Notification-channel policy belongs to the
|
|
10
|
+
* consuming SOS/Vet/UHC data package, not to the general FHIR data package.
|
|
11
|
+
*/
|
|
8
12
|
export declare const ImmunizationReminderChannels: readonly ["push", "email", "sms", "whatsapp", "telephone"];
|
|
9
13
|
export type ImmunizationReminderChannel = (typeof ImmunizationReminderChannels)[number];
|
|
10
14
|
export type ImmunizationReminderPlanInput = Readonly<{
|
|
@@ -8,6 +8,10 @@ export const ImmunizationReminderTaskValues = Object.freeze({
|
|
|
8
8
|
Code: 'immunization-reminder',
|
|
9
9
|
TriggerType: 'scheduled',
|
|
10
10
|
});
|
|
11
|
+
/**
|
|
12
|
+
* @deprecated Compatibility only. Notification-channel policy belongs to the
|
|
13
|
+
* consuming SOS/Vet/UHC data package, not to the general FHIR data package.
|
|
14
|
+
*/
|
|
11
15
|
export const ImmunizationReminderChannels = Object.freeze([
|
|
12
16
|
'push',
|
|
13
17
|
'email',
|
package/dist/builders/index.d.ts
CHANGED
package/dist/builders/index.js
CHANGED
|
@@ -21,6 +21,7 @@ export declare enum TaskClaimsFhirApi {
|
|
|
21
21
|
BasedOn = "Task.based-on",
|
|
22
22
|
BasedOnDisplay = "Task.based-on-display",
|
|
23
23
|
Language = "Task.language",
|
|
24
|
+
/** @deprecated Non-standard compatibility claim. Model delivery policy outside FHIR. */
|
|
24
25
|
Channel = "Task.channel",
|
|
25
26
|
AuthoredOn = "Task.authored-on",
|
|
26
27
|
LastModified = "Task.last-modified",
|
|
@@ -24,6 +24,7 @@ export var TaskClaimsFhirApi;
|
|
|
24
24
|
TaskClaimsFhirApi["BasedOn"] = "Task.based-on";
|
|
25
25
|
TaskClaimsFhirApi["BasedOnDisplay"] = "Task.based-on-display";
|
|
26
26
|
TaskClaimsFhirApi["Language"] = "Task.language";
|
|
27
|
+
/** @deprecated Non-standard compatibility claim. Model delivery policy outside FHIR. */
|
|
27
28
|
TaskClaimsFhirApi["Channel"] = "Task.channel";
|
|
28
29
|
TaskClaimsFhirApi["AuthoredOn"] = "Task.authored-on";
|
|
29
30
|
TaskClaimsFhirApi["LastModified"] = "Task.last-modified";
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { FhirBundle, FhirResource } from '../fhir-types.js';
|
|
2
|
+
/** Repository-safe reusable evidence for appointment Bundle and calendar tests. */
|
|
3
|
+
export declare const FHIR_APPOINTMENT_COMMUNICATION_TEST_DATA: Readonly<{
|
|
4
|
+
release: "r5";
|
|
5
|
+
start: "2026-10-05T16:00:00.000Z";
|
|
6
|
+
end: "2026-10-05T16:30:00.000Z";
|
|
7
|
+
communicationId: "communication-one";
|
|
8
|
+
subjectReference: "Patient/animal-one";
|
|
9
|
+
senderReference: "Organization/clinic-one";
|
|
10
|
+
recipientReference: "RelatedPerson/controller-one";
|
|
11
|
+
appointmentReference: "Appointment/appointment-one";
|
|
12
|
+
calendarData: string;
|
|
13
|
+
appointment: Readonly<{
|
|
14
|
+
[key: string]: unknown;
|
|
15
|
+
resourceType: string;
|
|
16
|
+
id?: string;
|
|
17
|
+
language?: string;
|
|
18
|
+
meta?: Readonly<Record<string, unknown>>;
|
|
19
|
+
contained?: readonly FhirResource[];
|
|
20
|
+
}>;
|
|
21
|
+
calendarDocument: Readonly<{
|
|
22
|
+
[key: string]: unknown;
|
|
23
|
+
resourceType: string;
|
|
24
|
+
id?: string;
|
|
25
|
+
language?: string;
|
|
26
|
+
meta?: Readonly<Record<string, unknown>>;
|
|
27
|
+
contained?: readonly FhirResource[];
|
|
28
|
+
}>;
|
|
29
|
+
communication: Readonly<{
|
|
30
|
+
[key: string]: unknown;
|
|
31
|
+
resourceType: string;
|
|
32
|
+
id?: string;
|
|
33
|
+
language?: string;
|
|
34
|
+
meta?: Readonly<Record<string, unknown>>;
|
|
35
|
+
contained?: readonly FhirResource[];
|
|
36
|
+
}>;
|
|
37
|
+
outerBatch: FhirBundle;
|
|
38
|
+
outerBatchWithInvalidDocument: FhirBundle;
|
|
39
|
+
outerBatchWithInvalidInnerBatch: FhirBundle;
|
|
40
|
+
outerBatchWithBareAppointment: Readonly<{
|
|
41
|
+
resourceType: "Bundle";
|
|
42
|
+
type: "batch";
|
|
43
|
+
entry: {
|
|
44
|
+
resource: {
|
|
45
|
+
payload: {
|
|
46
|
+
contentAttachment: {
|
|
47
|
+
contentType: string;
|
|
48
|
+
data: string;
|
|
49
|
+
};
|
|
50
|
+
}[];
|
|
51
|
+
resourceType: string;
|
|
52
|
+
id?: string;
|
|
53
|
+
language?: string;
|
|
54
|
+
meta?: Readonly<Record<string, unknown>>;
|
|
55
|
+
contained?: readonly FhirResource[];
|
|
56
|
+
};
|
|
57
|
+
request: {
|
|
58
|
+
method: string;
|
|
59
|
+
url: string;
|
|
60
|
+
};
|
|
61
|
+
}[];
|
|
62
|
+
}>;
|
|
63
|
+
}>;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
const APPOINTMENT_ID = 'appointment-one';
|
|
2
|
+
const COMMUNICATION_ID = 'communication-one';
|
|
3
|
+
const CALENDAR_DOCUMENT_ID = 'appointment-calendar-one';
|
|
4
|
+
const SUBJECT_REFERENCE = 'Patient/animal-one';
|
|
5
|
+
const SENDER_REFERENCE = 'Organization/clinic-one';
|
|
6
|
+
const RECIPIENT_REFERENCE = 'RelatedPerson/controller-one';
|
|
7
|
+
const APPOINTMENT_REFERENCE = `Appointment/${APPOINTMENT_ID}`;
|
|
8
|
+
const CALENDAR_DOCUMENT_REFERENCE = `DocumentReference/${CALENDAR_DOCUMENT_ID}`;
|
|
9
|
+
const APPOINTMENT_START = '2026-10-05T16:00:00.000Z';
|
|
10
|
+
const APPOINTMENT_END = '2026-10-05T16:30:00.000Z';
|
|
11
|
+
const CALENDAR_DATA = encodeBase64Utf8('BEGIN:VCALENDAR\r\nVERSION:2.0\r\nBEGIN:VEVENT\r\nDTSTART:20261005T160000Z\r\nDTEND:20261005T163000Z\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n');
|
|
12
|
+
const APPOINTMENT = Object.freeze({
|
|
13
|
+
resourceType: 'Appointment', id: APPOINTMENT_ID, identifier: [{ value: APPOINTMENT_ID }], status: 'booked',
|
|
14
|
+
start: APPOINTMENT_START, end: APPOINTMENT_END,
|
|
15
|
+
participant: [{ actor: { reference: SUBJECT_REFERENCE }, status: 'accepted' }, { actor: { reference: 'PractitionerRole/veterinarian-one' }, status: 'accepted' }, { actor: { reference: 'Location/consultation-one' }, status: 'accepted' }],
|
|
16
|
+
slot: [{ reference: 'Slot/consultation-one' }], supportingInformation: [{ reference: CALENDAR_DOCUMENT_REFERENCE }],
|
|
17
|
+
});
|
|
18
|
+
const CALENDAR_DOCUMENT = Object.freeze({
|
|
19
|
+
resourceType: 'DocumentReference', id: CALENDAR_DOCUMENT_ID, identifier: [{ value: CALENDAR_DOCUMENT_ID }], status: 'current',
|
|
20
|
+
subject: { reference: SUBJECT_REFERENCE }, context: { related: [{ reference: APPOINTMENT_REFERENCE }] },
|
|
21
|
+
content: [{ attachment: { contentType: 'text/calendar', data: CALENDAR_DATA, title: 'appointment.ics' } }],
|
|
22
|
+
});
|
|
23
|
+
const INNER_BUNDLE = Object.freeze({ resourceType: 'Bundle', type: 'collection', entry: [{ resource: APPOINTMENT }, { resource: CALENDAR_DOCUMENT }] });
|
|
24
|
+
const COMMUNICATION = Object.freeze({
|
|
25
|
+
resourceType: 'Communication', id: COMMUNICATION_ID, identifier: [{ value: COMMUNICATION_ID }], status: 'completed',
|
|
26
|
+
subject: { reference: SUBJECT_REFERENCE }, recipient: [{ reference: RECIPIENT_REFERENCE }], sender: { reference: SENDER_REFERENCE },
|
|
27
|
+
payload: [{ contentAttachment: { contentType: 'application/fhir+json', data: encodeBase64Utf8(JSON.stringify(INNER_BUNDLE)), title: 'appointment-bundle.json' } }],
|
|
28
|
+
});
|
|
29
|
+
function communicationWithInnerBundle(innerBundle) {
|
|
30
|
+
return Object.freeze({
|
|
31
|
+
...COMMUNICATION,
|
|
32
|
+
payload: [{ contentAttachment: { contentType: 'application/fhir+json', data: encodeBase64Utf8(JSON.stringify(innerBundle)) } }],
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
function outerBatchWithCommunication(communication) {
|
|
36
|
+
return Object.freeze({
|
|
37
|
+
resourceType: 'Bundle',
|
|
38
|
+
type: 'batch',
|
|
39
|
+
entry: [{ resource: communication, request: { method: 'POST', url: 'Communication' } }],
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
/** Repository-safe reusable evidence for appointment Bundle and calendar tests. */
|
|
43
|
+
export const FHIR_APPOINTMENT_COMMUNICATION_TEST_DATA = Object.freeze({
|
|
44
|
+
release: 'r5',
|
|
45
|
+
start: APPOINTMENT_START,
|
|
46
|
+
end: APPOINTMENT_END,
|
|
47
|
+
communicationId: COMMUNICATION_ID,
|
|
48
|
+
subjectReference: SUBJECT_REFERENCE,
|
|
49
|
+
senderReference: SENDER_REFERENCE,
|
|
50
|
+
recipientReference: RECIPIENT_REFERENCE,
|
|
51
|
+
appointmentReference: APPOINTMENT_REFERENCE,
|
|
52
|
+
calendarData: CALENDAR_DATA,
|
|
53
|
+
appointment: APPOINTMENT,
|
|
54
|
+
calendarDocument: CALENDAR_DOCUMENT,
|
|
55
|
+
communication: COMMUNICATION,
|
|
56
|
+
outerBatch: outerBatchWithCommunication(COMMUNICATION),
|
|
57
|
+
outerBatchWithInvalidDocument: outerBatchWithCommunication(communicationWithInnerBundle(Object.freeze({
|
|
58
|
+
resourceType: 'Bundle',
|
|
59
|
+
type: 'document',
|
|
60
|
+
entry: [{ resource: APPOINTMENT }],
|
|
61
|
+
}))),
|
|
62
|
+
outerBatchWithInvalidInnerBatch: outerBatchWithCommunication(communicationWithInnerBundle(Object.freeze({
|
|
63
|
+
resourceType: 'Bundle',
|
|
64
|
+
type: 'batch',
|
|
65
|
+
entry: [{ resource: APPOINTMENT }],
|
|
66
|
+
}))),
|
|
67
|
+
outerBatchWithBareAppointment: Object.freeze({
|
|
68
|
+
resourceType: 'Bundle', type: 'batch', entry: [{ resource: { ...COMMUNICATION, payload: [{ contentAttachment: { contentType: 'application/fhir+json', data: encodeBase64Utf8(JSON.stringify(APPOINTMENT)) } }] }, request: { method: 'POST', url: 'Communication' } }],
|
|
69
|
+
}),
|
|
70
|
+
});
|
|
71
|
+
function encodeBase64Utf8(value) {
|
|
72
|
+
const bytes = new TextEncoder().encode(value);
|
|
73
|
+
let binary = '';
|
|
74
|
+
for (const byte of bytes)
|
|
75
|
+
binary += String.fromCharCode(byte);
|
|
76
|
+
return globalThis.btoa(binary);
|
|
77
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { EncounterStatusR5 } from '../claims/encounter-claims.js';
|
|
2
|
+
/** Product-neutral identifiers and references for cross-package Encounter transfer contract tests. */
|
|
3
|
+
export declare const FHIR_ENCOUNTER_TRANSFER_TEST_DATA: Readonly<{
|
|
4
|
+
communicationIdentifier: "urn:uuid:00000000-0000-4000-8000-000000000401";
|
|
5
|
+
subjectReference: "Patient/00000000-0000-4000-8000-000000000402";
|
|
6
|
+
senderReference: "Organization/00000000-0000-4000-8000-000000000403";
|
|
7
|
+
indexRecipientReference: "Organization/00000000-0000-4000-8000-000000000404";
|
|
8
|
+
occurredAt: "2026-09-30T10:10:00Z";
|
|
9
|
+
invalidOccurredAtWithoutTimezone: "2026-09-30T10:10:00";
|
|
10
|
+
class: Readonly<{
|
|
11
|
+
system: "http://terminology.hl7.org/CodeSystem/v3-ActCode";
|
|
12
|
+
code: "EMER";
|
|
13
|
+
}>;
|
|
14
|
+
source: Readonly<{
|
|
15
|
+
id: "00000000-0000-4000-8000-000000000405";
|
|
16
|
+
reference: "Encounter/00000000-0000-4000-8000-000000000405";
|
|
17
|
+
identifier: "urn:uuid:00000000-0000-4000-8000-000000000405";
|
|
18
|
+
serviceReference: "HealthcareService/00000000-0000-4000-8000-000000000406";
|
|
19
|
+
locationReference: "Location/00000000-0000-4000-8000-000000000407";
|
|
20
|
+
statusWhenReturning: EncounterStatusR5.OnHold;
|
|
21
|
+
statusWhenNotReturning: EncounterStatusR5.Completed;
|
|
22
|
+
}>;
|
|
23
|
+
destination: Readonly<{
|
|
24
|
+
id: "00000000-0000-4000-8000-000000000408";
|
|
25
|
+
reference: "Encounter/00000000-0000-4000-8000-000000000408";
|
|
26
|
+
identifier: "urn:uuid:00000000-0000-4000-8000-000000000408";
|
|
27
|
+
serviceReference: "HealthcareService/00000000-0000-4000-8000-000000000409";
|
|
28
|
+
locationReference: "Location/00000000-0000-4000-8000-000000000410";
|
|
29
|
+
statusOnArrival: EncounterStatusR5.InProgress;
|
|
30
|
+
}>;
|
|
31
|
+
sourceHistory: Readonly<{
|
|
32
|
+
id: "00000000-0000-4000-8000-000000000411";
|
|
33
|
+
identifier: "urn:uuid:00000000-0000-4000-8000-000000000411";
|
|
34
|
+
encounterReference: "Encounter/00000000-0000-4000-8000-000000000405";
|
|
35
|
+
}>;
|
|
36
|
+
destinationHistory: Readonly<{
|
|
37
|
+
id: "00000000-0000-4000-8000-000000000412";
|
|
38
|
+
identifier: "urn:uuid:00000000-0000-4000-8000-000000000412";
|
|
39
|
+
encounterReference: "Encounter/00000000-0000-4000-8000-000000000408";
|
|
40
|
+
}>;
|
|
41
|
+
}>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { EncounterStatusR5 } from '../claims/encounter-claims.js';
|
|
2
|
+
/** Product-neutral identifiers and references for cross-package Encounter transfer contract tests. */
|
|
3
|
+
export const FHIR_ENCOUNTER_TRANSFER_TEST_DATA = Object.freeze({
|
|
4
|
+
communicationIdentifier: 'urn:uuid:00000000-0000-4000-8000-000000000401',
|
|
5
|
+
subjectReference: 'Patient/00000000-0000-4000-8000-000000000402',
|
|
6
|
+
senderReference: 'Organization/00000000-0000-4000-8000-000000000403',
|
|
7
|
+
indexRecipientReference: 'Organization/00000000-0000-4000-8000-000000000404',
|
|
8
|
+
occurredAt: '2026-09-30T10:10:00Z',
|
|
9
|
+
invalidOccurredAtWithoutTimezone: '2026-09-30T10:10:00',
|
|
10
|
+
class: Object.freeze({ system: 'http://terminology.hl7.org/CodeSystem/v3-ActCode', code: 'EMER' }),
|
|
11
|
+
source: Object.freeze({
|
|
12
|
+
id: '00000000-0000-4000-8000-000000000405',
|
|
13
|
+
reference: 'Encounter/00000000-0000-4000-8000-000000000405',
|
|
14
|
+
identifier: 'urn:uuid:00000000-0000-4000-8000-000000000405',
|
|
15
|
+
serviceReference: 'HealthcareService/00000000-0000-4000-8000-000000000406',
|
|
16
|
+
locationReference: 'Location/00000000-0000-4000-8000-000000000407',
|
|
17
|
+
statusWhenReturning: EncounterStatusR5.OnHold,
|
|
18
|
+
statusWhenNotReturning: EncounterStatusR5.Completed,
|
|
19
|
+
}),
|
|
20
|
+
destination: Object.freeze({
|
|
21
|
+
id: '00000000-0000-4000-8000-000000000408',
|
|
22
|
+
reference: 'Encounter/00000000-0000-4000-8000-000000000408',
|
|
23
|
+
identifier: 'urn:uuid:00000000-0000-4000-8000-000000000408',
|
|
24
|
+
serviceReference: 'HealthcareService/00000000-0000-4000-8000-000000000409',
|
|
25
|
+
locationReference: 'Location/00000000-0000-4000-8000-000000000410',
|
|
26
|
+
statusOnArrival: EncounterStatusR5.InProgress,
|
|
27
|
+
}),
|
|
28
|
+
sourceHistory: Object.freeze({
|
|
29
|
+
id: '00000000-0000-4000-8000-000000000411',
|
|
30
|
+
identifier: 'urn:uuid:00000000-0000-4000-8000-000000000411',
|
|
31
|
+
encounterReference: 'Encounter/00000000-0000-4000-8000-000000000405',
|
|
32
|
+
}),
|
|
33
|
+
destinationHistory: Object.freeze({
|
|
34
|
+
id: '00000000-0000-4000-8000-000000000412',
|
|
35
|
+
identifier: 'urn:uuid:00000000-0000-4000-8000-000000000412',
|
|
36
|
+
encounterReference: 'Encounter/00000000-0000-4000-8000-000000000408',
|
|
37
|
+
}),
|
|
38
|
+
});
|
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
/** Repository-safe synthetic IPS document used by portal demos and visual tests. */
|
|
2
|
+
/**
|
|
3
|
+
* Complete synthetic IPS screen fixture.
|
|
4
|
+
*
|
|
5
|
+
* It intentionally uses `Doe`, contains no telephone number, and covers the
|
|
6
|
+
* sixteen clinical sections in the official IPS all-sections order. It is
|
|
7
|
+
* presentation/test data only and never represents authorization or consent.
|
|
8
|
+
*/
|
|
9
|
+
export declare const FHIR_IPS_ALL_SECTIONS_DEMO_DATA: Readonly<{
|
|
10
|
+
subject: Readonly<{
|
|
11
|
+
reference: "Patient/jane-doe-demo";
|
|
12
|
+
givenName: "Jane";
|
|
13
|
+
familyName: "Doe";
|
|
14
|
+
displayName: "Jane Doe";
|
|
15
|
+
}>;
|
|
16
|
+
sectionCount: 16;
|
|
17
|
+
bundle: Readonly<{
|
|
18
|
+
resourceType: "Bundle";
|
|
19
|
+
id: "bundle-ips-all-sections-demo";
|
|
20
|
+
type: "document";
|
|
21
|
+
timestamp: "2026-09-30T10:20:00Z";
|
|
22
|
+
entry: readonly ({
|
|
23
|
+
fullUrl: string;
|
|
24
|
+
resource: {
|
|
25
|
+
patient: {
|
|
26
|
+
reference: string;
|
|
27
|
+
};
|
|
28
|
+
clinicalStatus: {
|
|
29
|
+
text: string;
|
|
30
|
+
};
|
|
31
|
+
verificationStatus: {
|
|
32
|
+
text: string;
|
|
33
|
+
};
|
|
34
|
+
code: {
|
|
35
|
+
text: string;
|
|
36
|
+
coding: {
|
|
37
|
+
system: string;
|
|
38
|
+
code: string;
|
|
39
|
+
display: string;
|
|
40
|
+
}[];
|
|
41
|
+
};
|
|
42
|
+
resourceType: "Condition" | "Goal" | "AllergyIntolerance" | "Procedure" | "DiagnosticReport" | "Observation" | "Immunization" | "CarePlan" | "ClinicalImpression" | "Consent" | "DeviceUseStatement" | "Flag" | "MedicationStatement";
|
|
43
|
+
id: string;
|
|
44
|
+
status: string;
|
|
45
|
+
subject: {
|
|
46
|
+
reference: string;
|
|
47
|
+
};
|
|
48
|
+
} | {
|
|
49
|
+
status: string;
|
|
50
|
+
medicationCodeableConcept: {
|
|
51
|
+
text: string;
|
|
52
|
+
coding: {
|
|
53
|
+
system: string;
|
|
54
|
+
code: string;
|
|
55
|
+
display: string;
|
|
56
|
+
}[];
|
|
57
|
+
};
|
|
58
|
+
effectiveDateTime: string;
|
|
59
|
+
resourceType: "Condition" | "Goal" | "AllergyIntolerance" | "Procedure" | "DiagnosticReport" | "Observation" | "Immunization" | "CarePlan" | "ClinicalImpression" | "Consent" | "DeviceUseStatement" | "Flag" | "MedicationStatement";
|
|
60
|
+
id: string;
|
|
61
|
+
subject: {
|
|
62
|
+
reference: string;
|
|
63
|
+
};
|
|
64
|
+
} | {
|
|
65
|
+
status: string;
|
|
66
|
+
patient: {
|
|
67
|
+
reference: string;
|
|
68
|
+
};
|
|
69
|
+
vaccineCode: {
|
|
70
|
+
text: string;
|
|
71
|
+
coding: {
|
|
72
|
+
system: string;
|
|
73
|
+
code: string;
|
|
74
|
+
display: string;
|
|
75
|
+
}[];
|
|
76
|
+
};
|
|
77
|
+
occurrenceDateTime: string;
|
|
78
|
+
resourceType: "Condition" | "Goal" | "AllergyIntolerance" | "Procedure" | "DiagnosticReport" | "Observation" | "Immunization" | "CarePlan" | "ClinicalImpression" | "Consent" | "DeviceUseStatement" | "Flag" | "MedicationStatement";
|
|
79
|
+
id: string;
|
|
80
|
+
subject: {
|
|
81
|
+
reference: string;
|
|
82
|
+
};
|
|
83
|
+
} | {
|
|
84
|
+
status: string;
|
|
85
|
+
code: {
|
|
86
|
+
text: string;
|
|
87
|
+
coding: {
|
|
88
|
+
system: string;
|
|
89
|
+
code: string;
|
|
90
|
+
display: string;
|
|
91
|
+
}[];
|
|
92
|
+
};
|
|
93
|
+
effectiveDateTime: string;
|
|
94
|
+
resourceType: "Condition" | "Goal" | "AllergyIntolerance" | "Procedure" | "DiagnosticReport" | "Observation" | "Immunization" | "CarePlan" | "ClinicalImpression" | "Consent" | "DeviceUseStatement" | "Flag" | "MedicationStatement";
|
|
95
|
+
id: string;
|
|
96
|
+
subject: {
|
|
97
|
+
reference: string;
|
|
98
|
+
};
|
|
99
|
+
} | {
|
|
100
|
+
status: string;
|
|
101
|
+
code: {
|
|
102
|
+
text: string;
|
|
103
|
+
coding: {
|
|
104
|
+
system: string;
|
|
105
|
+
code: string;
|
|
106
|
+
display: string;
|
|
107
|
+
}[];
|
|
108
|
+
};
|
|
109
|
+
performedDateTime: string;
|
|
110
|
+
resourceType: "Condition" | "Goal" | "AllergyIntolerance" | "Procedure" | "DiagnosticReport" | "Observation" | "Immunization" | "CarePlan" | "ClinicalImpression" | "Consent" | "DeviceUseStatement" | "Flag" | "MedicationStatement";
|
|
111
|
+
id: string;
|
|
112
|
+
subject: {
|
|
113
|
+
reference: string;
|
|
114
|
+
};
|
|
115
|
+
} | {
|
|
116
|
+
status: string;
|
|
117
|
+
device: {
|
|
118
|
+
display: "Corrective lens use";
|
|
119
|
+
};
|
|
120
|
+
resourceType: "Condition" | "Goal" | "AllergyIntolerance" | "Procedure" | "DiagnosticReport" | "Observation" | "Immunization" | "CarePlan" | "ClinicalImpression" | "Consent" | "DeviceUseStatement" | "Flag" | "MedicationStatement";
|
|
121
|
+
id: string;
|
|
122
|
+
subject: {
|
|
123
|
+
reference: string;
|
|
124
|
+
};
|
|
125
|
+
} | {
|
|
126
|
+
code: {
|
|
127
|
+
text: string;
|
|
128
|
+
coding: {
|
|
129
|
+
system: string;
|
|
130
|
+
code: string;
|
|
131
|
+
display: string;
|
|
132
|
+
}[];
|
|
133
|
+
};
|
|
134
|
+
effectiveDateTime: string;
|
|
135
|
+
valueQuantity: {
|
|
136
|
+
value: number;
|
|
137
|
+
unit: string;
|
|
138
|
+
system: string;
|
|
139
|
+
code: string;
|
|
140
|
+
};
|
|
141
|
+
resourceType: "Condition" | "Goal" | "AllergyIntolerance" | "Procedure" | "DiagnosticReport" | "Observation" | "Immunization" | "CarePlan" | "ClinicalImpression" | "Consent" | "DeviceUseStatement" | "Flag" | "MedicationStatement";
|
|
142
|
+
id: string;
|
|
143
|
+
status: string;
|
|
144
|
+
subject: {
|
|
145
|
+
reference: string;
|
|
146
|
+
};
|
|
147
|
+
} | {
|
|
148
|
+
code: {
|
|
149
|
+
text: string;
|
|
150
|
+
coding: {
|
|
151
|
+
system: string;
|
|
152
|
+
code: string;
|
|
153
|
+
display: string;
|
|
154
|
+
}[];
|
|
155
|
+
};
|
|
156
|
+
effectiveDateTime: string;
|
|
157
|
+
valueCodeableConcept: {
|
|
158
|
+
text: string;
|
|
159
|
+
coding: {
|
|
160
|
+
system: string;
|
|
161
|
+
code: string;
|
|
162
|
+
display: string;
|
|
163
|
+
}[];
|
|
164
|
+
};
|
|
165
|
+
resourceType: "Condition" | "Goal" | "AllergyIntolerance" | "Procedure" | "DiagnosticReport" | "Observation" | "Immunization" | "CarePlan" | "ClinicalImpression" | "Consent" | "DeviceUseStatement" | "Flag" | "MedicationStatement";
|
|
166
|
+
id: string;
|
|
167
|
+
status: string;
|
|
168
|
+
subject: {
|
|
169
|
+
reference: string;
|
|
170
|
+
};
|
|
171
|
+
} | {
|
|
172
|
+
status: string;
|
|
173
|
+
code: {
|
|
174
|
+
text: string;
|
|
175
|
+
coding: {
|
|
176
|
+
system: string;
|
|
177
|
+
code: string;
|
|
178
|
+
display: string;
|
|
179
|
+
}[];
|
|
180
|
+
};
|
|
181
|
+
resourceType: "Condition" | "Goal" | "AllergyIntolerance" | "Procedure" | "DiagnosticReport" | "Observation" | "Immunization" | "CarePlan" | "ClinicalImpression" | "Consent" | "DeviceUseStatement" | "Flag" | "MedicationStatement";
|
|
182
|
+
id: string;
|
|
183
|
+
subject: {
|
|
184
|
+
reference: string;
|
|
185
|
+
};
|
|
186
|
+
} | {
|
|
187
|
+
lifecycleStatus: string;
|
|
188
|
+
description: {
|
|
189
|
+
text: string;
|
|
190
|
+
coding: {
|
|
191
|
+
system: string;
|
|
192
|
+
code: string;
|
|
193
|
+
display: string;
|
|
194
|
+
}[];
|
|
195
|
+
};
|
|
196
|
+
resourceType: "Condition" | "Goal" | "AllergyIntolerance" | "Procedure" | "DiagnosticReport" | "Observation" | "Immunization" | "CarePlan" | "ClinicalImpression" | "Consent" | "DeviceUseStatement" | "Flag" | "MedicationStatement";
|
|
197
|
+
id: string;
|
|
198
|
+
status: string;
|
|
199
|
+
subject: {
|
|
200
|
+
reference: string;
|
|
201
|
+
};
|
|
202
|
+
} | {
|
|
203
|
+
status: string;
|
|
204
|
+
scope: {
|
|
205
|
+
text: string;
|
|
206
|
+
coding: {
|
|
207
|
+
system: string;
|
|
208
|
+
code: string;
|
|
209
|
+
display: string;
|
|
210
|
+
}[];
|
|
211
|
+
};
|
|
212
|
+
category: {
|
|
213
|
+
text: string;
|
|
214
|
+
coding: {
|
|
215
|
+
system: string;
|
|
216
|
+
code: string;
|
|
217
|
+
display: string;
|
|
218
|
+
}[];
|
|
219
|
+
}[];
|
|
220
|
+
patient: {
|
|
221
|
+
reference: string;
|
|
222
|
+
};
|
|
223
|
+
resourceType: "Condition" | "Goal" | "AllergyIntolerance" | "Procedure" | "DiagnosticReport" | "Observation" | "Immunization" | "CarePlan" | "ClinicalImpression" | "Consent" | "DeviceUseStatement" | "Flag" | "MedicationStatement";
|
|
224
|
+
id: string;
|
|
225
|
+
subject: {
|
|
226
|
+
reference: string;
|
|
227
|
+
};
|
|
228
|
+
} | {
|
|
229
|
+
status: string;
|
|
230
|
+
description: "Independent daily activities";
|
|
231
|
+
summary: "Independent daily activities";
|
|
232
|
+
resourceType: "Condition" | "Goal" | "AllergyIntolerance" | "Procedure" | "DiagnosticReport" | "Observation" | "Immunization" | "CarePlan" | "ClinicalImpression" | "Consent" | "DeviceUseStatement" | "Flag" | "MedicationStatement";
|
|
233
|
+
id: string;
|
|
234
|
+
subject: {
|
|
235
|
+
reference: string;
|
|
236
|
+
};
|
|
237
|
+
} | {
|
|
238
|
+
status: string;
|
|
239
|
+
intent: string;
|
|
240
|
+
title: "Emergency follow-up plan";
|
|
241
|
+
category: {
|
|
242
|
+
text: string;
|
|
243
|
+
coding: {
|
|
244
|
+
system: string;
|
|
245
|
+
code: string;
|
|
246
|
+
display: string;
|
|
247
|
+
}[];
|
|
248
|
+
}[];
|
|
249
|
+
resourceType: "Condition" | "Goal" | "AllergyIntolerance" | "Procedure" | "DiagnosticReport" | "Observation" | "Immunization" | "CarePlan" | "ClinicalImpression" | "Consent" | "DeviceUseStatement" | "Flag" | "MedicationStatement";
|
|
250
|
+
id: string;
|
|
251
|
+
subject: {
|
|
252
|
+
reference: string;
|
|
253
|
+
};
|
|
254
|
+
} | {
|
|
255
|
+
clinicalStatus: {
|
|
256
|
+
text: string;
|
|
257
|
+
};
|
|
258
|
+
code: {
|
|
259
|
+
text: string;
|
|
260
|
+
coding: {
|
|
261
|
+
system: string;
|
|
262
|
+
code: string;
|
|
263
|
+
display: string;
|
|
264
|
+
}[];
|
|
265
|
+
};
|
|
266
|
+
resourceType: "Condition" | "Goal" | "AllergyIntolerance" | "Procedure" | "DiagnosticReport" | "Observation" | "Immunization" | "CarePlan" | "ClinicalImpression" | "Consent" | "DeviceUseStatement" | "Flag" | "MedicationStatement";
|
|
267
|
+
id: string;
|
|
268
|
+
status: string;
|
|
269
|
+
subject: {
|
|
270
|
+
reference: string;
|
|
271
|
+
};
|
|
272
|
+
};
|
|
273
|
+
} | {
|
|
274
|
+
fullUrl: string;
|
|
275
|
+
resource: Readonly<{
|
|
276
|
+
resourceType: "Composition";
|
|
277
|
+
id: "ips-all-sections-demo";
|
|
278
|
+
status: "final";
|
|
279
|
+
type: {
|
|
280
|
+
coding: {
|
|
281
|
+
system: string;
|
|
282
|
+
code: string;
|
|
283
|
+
display: string;
|
|
284
|
+
}[];
|
|
285
|
+
};
|
|
286
|
+
subject: {
|
|
287
|
+
reference: string;
|
|
288
|
+
};
|
|
289
|
+
date: "2026-09-30T10:20:00Z";
|
|
290
|
+
author: {
|
|
291
|
+
reference: string;
|
|
292
|
+
}[];
|
|
293
|
+
title: "International Patient Summary";
|
|
294
|
+
section: {
|
|
295
|
+
title: "Problem list" | "Allergies and adverse reactions" | "History of medication use" | "History of immunization" | "Relevant diagnostic tests and laboratory data" | "History of procedures" | "History of medical device use" | "Vital signs" | "Social history" | "Alerts" | "Goals and preferences" | "Advance directives" | "Functional status" | "History of past illness" | "Pregnancy history" | "Plan of care";
|
|
296
|
+
code: {
|
|
297
|
+
coding: {
|
|
298
|
+
system: string;
|
|
299
|
+
code: "11450-4" | "48765-2" | "10160-0" | "11369-6" | "30954-2" | "47519-4" | "46264-8" | "8716-3" | "29762-2" | "104605-1" | "81338-6" | "42348-3" | "47420-5" | "11348-0" | "10162-6" | "18776-5";
|
|
300
|
+
display: "Problem list" | "Allergies and adverse reactions" | "History of medication use" | "History of immunization" | "Relevant diagnostic tests and laboratory data" | "History of procedures" | "History of medical device use" | "Vital signs" | "Social history" | "Alerts" | "Goals and preferences" | "Advance directives" | "Functional status" | "History of past illness" | "Pregnancy history" | "Plan of care";
|
|
301
|
+
}[];
|
|
302
|
+
};
|
|
303
|
+
entry: {
|
|
304
|
+
reference: string;
|
|
305
|
+
}[];
|
|
306
|
+
}[];
|
|
307
|
+
}>;
|
|
308
|
+
} | {
|
|
309
|
+
fullUrl: string;
|
|
310
|
+
resource: {
|
|
311
|
+
resourceType: string;
|
|
312
|
+
id: string;
|
|
313
|
+
name: {
|
|
314
|
+
given: string[];
|
|
315
|
+
family: string;
|
|
316
|
+
}[];
|
|
317
|
+
};
|
|
318
|
+
} | {
|
|
319
|
+
fullUrl: string;
|
|
320
|
+
resource: {
|
|
321
|
+
resourceType: string;
|
|
322
|
+
id: string;
|
|
323
|
+
name: string;
|
|
324
|
+
};
|
|
325
|
+
})[];
|
|
326
|
+
}>;
|
|
327
|
+
}>;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/** Repository-safe synthetic IPS document used by portal demos and visual tests. */
|
|
2
|
+
const LOINC_SYSTEM = 'http://loinc.org';
|
|
3
|
+
const SNOMED_SYSTEM = 'http://snomed.info/sct';
|
|
4
|
+
const SUBJECT_REFERENCE = 'Patient/jane-doe-demo';
|
|
5
|
+
const sectionDefinitions = Object.freeze([
|
|
6
|
+
['11450-4', 'Problem list', 'Condition', 'Hypertensive disorder'],
|
|
7
|
+
['48765-2', 'Allergies and adverse reactions', 'AllergyIntolerance', 'Penicillin allergy'],
|
|
8
|
+
['10160-0', 'History of medication use', 'MedicationStatement', 'Metformin therapy'],
|
|
9
|
+
['11369-6', 'History of immunization', 'Immunization', 'Influenza immunization'],
|
|
10
|
+
['30954-2', 'Relevant diagnostic tests and laboratory data', 'DiagnosticReport', 'Emergency laboratory panel'],
|
|
11
|
+
['47519-4', 'History of procedures', 'Procedure', 'Appendectomy'],
|
|
12
|
+
['46264-8', 'History of medical device use', 'DeviceUseStatement', 'Corrective lens use'],
|
|
13
|
+
['8716-3', 'Vital signs', 'Observation', 'Oxygen saturation'],
|
|
14
|
+
['29762-2', 'Social history', 'Observation', 'Tobacco use assessment'],
|
|
15
|
+
['104605-1', 'Alerts', 'Flag', 'Fall risk'],
|
|
16
|
+
['81338-6', 'Goals and preferences', 'Goal', 'Maintain independent mobility'],
|
|
17
|
+
['42348-3', 'Advance directives', 'Consent', 'Advance care directive'],
|
|
18
|
+
['47420-5', 'Functional status', 'ClinicalImpression', 'Independent daily activities'],
|
|
19
|
+
['11348-0', 'History of past illness', 'Condition', 'Resolved viral infection'],
|
|
20
|
+
['10162-6', 'Pregnancy history', 'Observation', 'Not pregnant'],
|
|
21
|
+
['18776-5', 'Plan of care', 'CarePlan', 'Emergency follow-up plan'],
|
|
22
|
+
]);
|
|
23
|
+
function concept(text, code) {
|
|
24
|
+
return { text, coding: [{ system: SNOMED_SYSTEM, code, display: text }] };
|
|
25
|
+
}
|
|
26
|
+
function clinicalResource([sectionCode, , resourceType, title], index) {
|
|
27
|
+
const id = `ips-demo-${sectionCode.replace(/\D/g, '')}-${index + 1}`;
|
|
28
|
+
const common = { resourceType, id, status: resourceType === 'Goal' ? 'active' : 'final', subject: { reference: SUBJECT_REFERENCE } };
|
|
29
|
+
const coded = concept(title, String(100000 + index));
|
|
30
|
+
switch (resourceType) {
|
|
31
|
+
case 'AllergyIntolerance':
|
|
32
|
+
return { ...common, patient: common.subject, clinicalStatus: { text: 'Active' }, verificationStatus: { text: 'Confirmed' }, code: coded };
|
|
33
|
+
case 'MedicationStatement':
|
|
34
|
+
return { ...common, status: 'active', medicationCodeableConcept: coded, effectiveDateTime: '2026-09-01T08:00:00Z' };
|
|
35
|
+
case 'Immunization':
|
|
36
|
+
return { ...common, status: 'completed', patient: common.subject, vaccineCode: coded, occurrenceDateTime: '2026-04-10T10:00:00Z' };
|
|
37
|
+
case 'DiagnosticReport':
|
|
38
|
+
return { ...common, status: 'final', code: coded, effectiveDateTime: '2026-09-30T09:20:00Z' };
|
|
39
|
+
case 'Procedure':
|
|
40
|
+
return { ...common, status: 'completed', code: coded, performedDateTime: '2019-06-12T10:00:00Z' };
|
|
41
|
+
case 'DeviceUseStatement':
|
|
42
|
+
return { ...common, status: 'active', device: { display: title } };
|
|
43
|
+
case 'Observation':
|
|
44
|
+
return sectionCode === '8716-3'
|
|
45
|
+
? { ...common, code: coded, effectiveDateTime: '2026-09-30T10:15:00Z', valueQuantity: { value: 97, unit: '%', system: 'http://unitsofmeasure.org', code: '%' } }
|
|
46
|
+
: { ...common, code: coded, effectiveDateTime: '2026-09-01T08:00:00Z', valueCodeableConcept: concept(title, String(200000 + index)) };
|
|
47
|
+
case 'Flag':
|
|
48
|
+
return { ...common, status: 'active', code: coded };
|
|
49
|
+
case 'Goal':
|
|
50
|
+
return { ...common, lifecycleStatus: 'active', description: coded };
|
|
51
|
+
case 'Consent':
|
|
52
|
+
return { ...common, status: 'active', scope: concept('Advance care', '385431004'), category: [coded], patient: common.subject };
|
|
53
|
+
case 'ClinicalImpression':
|
|
54
|
+
return { ...common, status: 'completed', description: title, summary: title };
|
|
55
|
+
case 'CarePlan':
|
|
56
|
+
return { ...common, status: 'active', intent: 'plan', title, category: [coded] };
|
|
57
|
+
default:
|
|
58
|
+
return { ...common, clinicalStatus: { text: sectionCode === '11348-0' ? 'Resolved' : 'Active' }, code: coded };
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
const clinicalResources = sectionDefinitions.map(clinicalResource);
|
|
62
|
+
const composition = Object.freeze({
|
|
63
|
+
resourceType: 'Composition',
|
|
64
|
+
id: 'ips-all-sections-demo',
|
|
65
|
+
status: 'final',
|
|
66
|
+
type: { coding: [{ system: LOINC_SYSTEM, code: '60591-5', display: 'Patient summary document' }] },
|
|
67
|
+
subject: { reference: SUBJECT_REFERENCE },
|
|
68
|
+
date: '2026-09-30T10:20:00Z',
|
|
69
|
+
author: [{ reference: 'Organization/demo-hospital' }],
|
|
70
|
+
title: 'International Patient Summary',
|
|
71
|
+
section: sectionDefinitions.map(([code, title], index) => ({
|
|
72
|
+
title,
|
|
73
|
+
code: { coding: [{ system: LOINC_SYSTEM, code, display: title }] },
|
|
74
|
+
entry: [{ reference: `${clinicalResources[index].resourceType}/${clinicalResources[index].id}` }],
|
|
75
|
+
})),
|
|
76
|
+
});
|
|
77
|
+
/**
|
|
78
|
+
* Complete synthetic IPS screen fixture.
|
|
79
|
+
*
|
|
80
|
+
* It intentionally uses `Doe`, contains no telephone number, and covers the
|
|
81
|
+
* sixteen clinical sections in the official IPS all-sections order. It is
|
|
82
|
+
* presentation/test data only and never represents authorization or consent.
|
|
83
|
+
*/
|
|
84
|
+
export const FHIR_IPS_ALL_SECTIONS_DEMO_DATA = Object.freeze({
|
|
85
|
+
subject: Object.freeze({
|
|
86
|
+
reference: SUBJECT_REFERENCE,
|
|
87
|
+
givenName: 'Jane',
|
|
88
|
+
familyName: 'Doe',
|
|
89
|
+
displayName: 'Jane Doe',
|
|
90
|
+
}),
|
|
91
|
+
sectionCount: sectionDefinitions.length,
|
|
92
|
+
bundle: Object.freeze({
|
|
93
|
+
resourceType: 'Bundle',
|
|
94
|
+
id: 'bundle-ips-all-sections-demo',
|
|
95
|
+
type: 'document',
|
|
96
|
+
timestamp: '2026-09-30T10:20:00Z',
|
|
97
|
+
entry: Object.freeze([
|
|
98
|
+
{ fullUrl: 'Composition/ips-all-sections-demo', resource: composition },
|
|
99
|
+
{
|
|
100
|
+
fullUrl: SUBJECT_REFERENCE,
|
|
101
|
+
resource: {
|
|
102
|
+
resourceType: 'Patient',
|
|
103
|
+
id: 'jane-doe-demo',
|
|
104
|
+
name: [{ given: ['Jane'], family: 'Doe' }],
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
fullUrl: 'Organization/demo-hospital',
|
|
109
|
+
resource: { resourceType: 'Organization', id: 'demo-hospital', name: 'Demo Hospital' },
|
|
110
|
+
},
|
|
111
|
+
...clinicalResources.map(resource => ({ fullUrl: `${resource.resourceType}/${resource.id}`, resource })),
|
|
112
|
+
]),
|
|
113
|
+
}),
|
|
114
|
+
});
|
|
@@ -1,41 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export declare const FHIR_ENCOUNTER_TRANSFER_TEST_DATA: Readonly<{
|
|
4
|
-
communicationIdentifier: "urn:uuid:00000000-0000-4000-8000-000000000401";
|
|
5
|
-
subjectReference: "Patient/00000000-0000-4000-8000-000000000402";
|
|
6
|
-
senderReference: "Organization/00000000-0000-4000-8000-000000000403";
|
|
7
|
-
indexRecipientReference: "Organization/00000000-0000-4000-8000-000000000404";
|
|
8
|
-
occurredAt: "2026-09-30T10:10:00Z";
|
|
9
|
-
invalidOccurredAtWithoutTimezone: "2026-09-30T10:10:00";
|
|
10
|
-
class: Readonly<{
|
|
11
|
-
system: "http://terminology.hl7.org/CodeSystem/v3-ActCode";
|
|
12
|
-
code: "EMER";
|
|
13
|
-
}>;
|
|
14
|
-
source: Readonly<{
|
|
15
|
-
id: "00000000-0000-4000-8000-000000000405";
|
|
16
|
-
reference: "Encounter/00000000-0000-4000-8000-000000000405";
|
|
17
|
-
identifier: "urn:uuid:00000000-0000-4000-8000-000000000405";
|
|
18
|
-
serviceReference: "HealthcareService/00000000-0000-4000-8000-000000000406";
|
|
19
|
-
locationReference: "Location/00000000-0000-4000-8000-000000000407";
|
|
20
|
-
statusWhenReturning: EncounterStatusR5.OnHold;
|
|
21
|
-
statusWhenNotReturning: EncounterStatusR5.Completed;
|
|
22
|
-
}>;
|
|
23
|
-
destination: Readonly<{
|
|
24
|
-
id: "00000000-0000-4000-8000-000000000408";
|
|
25
|
-
reference: "Encounter/00000000-0000-4000-8000-000000000408";
|
|
26
|
-
identifier: "urn:uuid:00000000-0000-4000-8000-000000000408";
|
|
27
|
-
serviceReference: "HealthcareService/00000000-0000-4000-8000-000000000409";
|
|
28
|
-
locationReference: "Location/00000000-0000-4000-8000-000000000410";
|
|
29
|
-
statusOnArrival: EncounterStatusR5.InProgress;
|
|
30
|
-
}>;
|
|
31
|
-
sourceHistory: Readonly<{
|
|
32
|
-
id: "00000000-0000-4000-8000-000000000411";
|
|
33
|
-
identifier: "urn:uuid:00000000-0000-4000-8000-000000000411";
|
|
34
|
-
encounterReference: "Encounter/00000000-0000-4000-8000-000000000405";
|
|
35
|
-
}>;
|
|
36
|
-
destinationHistory: Readonly<{
|
|
37
|
-
id: "00000000-0000-4000-8000-000000000412";
|
|
38
|
-
identifier: "urn:uuid:00000000-0000-4000-8000-000000000412";
|
|
39
|
-
encounterReference: "Encounter/00000000-0000-4000-8000-000000000408";
|
|
40
|
-
}>;
|
|
41
|
-
}>;
|
|
1
|
+
/** @deprecated Import reusable fixtures from `fhir-data-utils-ts/data`. */
|
|
2
|
+
export * from './data/encounter-transfer.data.js';
|
|
@@ -1,38 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export const FHIR_ENCOUNTER_TRANSFER_TEST_DATA = Object.freeze({
|
|
4
|
-
communicationIdentifier: 'urn:uuid:00000000-0000-4000-8000-000000000401',
|
|
5
|
-
subjectReference: 'Patient/00000000-0000-4000-8000-000000000402',
|
|
6
|
-
senderReference: 'Organization/00000000-0000-4000-8000-000000000403',
|
|
7
|
-
indexRecipientReference: 'Organization/00000000-0000-4000-8000-000000000404',
|
|
8
|
-
occurredAt: '2026-09-30T10:10:00Z',
|
|
9
|
-
invalidOccurredAtWithoutTimezone: '2026-09-30T10:10:00',
|
|
10
|
-
class: Object.freeze({ system: 'http://terminology.hl7.org/CodeSystem/v3-ActCode', code: 'EMER' }),
|
|
11
|
-
source: Object.freeze({
|
|
12
|
-
id: '00000000-0000-4000-8000-000000000405',
|
|
13
|
-
reference: 'Encounter/00000000-0000-4000-8000-000000000405',
|
|
14
|
-
identifier: 'urn:uuid:00000000-0000-4000-8000-000000000405',
|
|
15
|
-
serviceReference: 'HealthcareService/00000000-0000-4000-8000-000000000406',
|
|
16
|
-
locationReference: 'Location/00000000-0000-4000-8000-000000000407',
|
|
17
|
-
statusWhenReturning: EncounterStatusR5.OnHold,
|
|
18
|
-
statusWhenNotReturning: EncounterStatusR5.Completed,
|
|
19
|
-
}),
|
|
20
|
-
destination: Object.freeze({
|
|
21
|
-
id: '00000000-0000-4000-8000-000000000408',
|
|
22
|
-
reference: 'Encounter/00000000-0000-4000-8000-000000000408',
|
|
23
|
-
identifier: 'urn:uuid:00000000-0000-4000-8000-000000000408',
|
|
24
|
-
serviceReference: 'HealthcareService/00000000-0000-4000-8000-000000000409',
|
|
25
|
-
locationReference: 'Location/00000000-0000-4000-8000-000000000410',
|
|
26
|
-
statusOnArrival: EncounterStatusR5.InProgress,
|
|
27
|
-
}),
|
|
28
|
-
sourceHistory: Object.freeze({
|
|
29
|
-
id: '00000000-0000-4000-8000-000000000411',
|
|
30
|
-
identifier: 'urn:uuid:00000000-0000-4000-8000-000000000411',
|
|
31
|
-
encounterReference: 'Encounter/00000000-0000-4000-8000-000000000405',
|
|
32
|
-
}),
|
|
33
|
-
destinationHistory: Object.freeze({
|
|
34
|
-
id: '00000000-0000-4000-8000-000000000412',
|
|
35
|
-
identifier: 'urn:uuid:00000000-0000-4000-8000-000000000412',
|
|
36
|
-
encounterReference: 'Encounter/00000000-0000-4000-8000-000000000408',
|
|
37
|
-
}),
|
|
38
|
-
});
|
|
1
|
+
/** @deprecated Import reusable fixtures from `fhir-data-utils-ts/data`. */
|
|
2
|
+
export * from './data/encounter-transfer.data.js';
|
package/dist/index.d.ts
CHANGED
|
@@ -16,7 +16,6 @@ export * from './constants/index.js';
|
|
|
16
16
|
export * from './clinical-terminology.js';
|
|
17
17
|
export * from './care-emergency-alert.js';
|
|
18
18
|
export * from './immunization-flat-claims.js';
|
|
19
|
-
export * from './immunization-reminder-plan.js';
|
|
20
19
|
export * from './builders/index.js';
|
|
21
20
|
export * from './group-r5.js';
|
|
22
21
|
export * from './research-study-r5.js';
|
|
@@ -25,6 +24,5 @@ export * from './related-person.js';
|
|
|
25
24
|
export * from './imaging-types.js';
|
|
26
25
|
export * from './subscription-r5.js';
|
|
27
26
|
export * from './healthcare-service-specialty-map.js';
|
|
28
|
-
export * from './
|
|
29
|
-
export * from './encounter-transfer-test-data.js';
|
|
27
|
+
export * from './data/index.js';
|
|
30
28
|
export * from './fhir-instant.js';
|
package/dist/index.js
CHANGED
|
@@ -16,7 +16,6 @@ export * from './constants/index.js';
|
|
|
16
16
|
export * from './clinical-terminology.js';
|
|
17
17
|
export * from './care-emergency-alert.js';
|
|
18
18
|
export * from './immunization-flat-claims.js';
|
|
19
|
-
export * from './immunization-reminder-plan.js';
|
|
20
19
|
export * from './builders/index.js';
|
|
21
20
|
export * from './group-r5.js';
|
|
22
21
|
export * from './research-study-r5.js';
|
|
@@ -25,6 +24,5 @@ export * from './related-person.js';
|
|
|
25
24
|
export * from './imaging-types.js';
|
|
26
25
|
export * from './subscription-r5.js';
|
|
27
26
|
export * from './healthcare-service-specialty-map.js';
|
|
28
|
-
export * from './
|
|
29
|
-
export * from './encounter-transfer-test-data.js';
|
|
27
|
+
export * from './data/index.js';
|
|
30
28
|
export * from './fhir-instant.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fhir-data-utils-ts",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.4",
|
|
4
4
|
"description": "FHIR-version-neutral flat-claim and SearchParameter data utilities",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -122,6 +122,10 @@
|
|
|
122
122
|
"./constants": {
|
|
123
123
|
"types": "./dist/constants/index.d.ts",
|
|
124
124
|
"default": "./dist/constants/index.js"
|
|
125
|
+
},
|
|
126
|
+
"./data": {
|
|
127
|
+
"types": "./dist/data/index.d.ts",
|
|
128
|
+
"default": "./dist/data/index.js"
|
|
125
129
|
}
|
|
126
130
|
},
|
|
127
131
|
"files": [
|
|
@@ -136,7 +140,7 @@
|
|
|
136
140
|
"build": "npm run clean && tsc -p tsconfig.json",
|
|
137
141
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
138
142
|
"test": "npm run build && node --test tests/*.test.mjs",
|
|
139
|
-
"test:coverage": "node --test --experimental-test-coverage --test-coverage-include='dist/converters/*.js' --test-coverage-include='dist/builders/*.js' --test-coverage-include='dist/fhir-*.js' --test-coverage-lines=95 --test-coverage-functions=80 --test-coverage-branches=40 tests/*.test.mjs",
|
|
143
|
+
"test:coverage": "node --test --experimental-test-coverage --test-coverage-include='dist/converters/*.js' --test-coverage-include='dist/builders/*.js' --test-coverage-include='dist/fhir-*.js' --test-coverage-exclude='dist/**/*.data.js' --test-coverage-lines=95 --test-coverage-functions=80 --test-coverage-branches=40 tests/*.test.mjs",
|
|
140
144
|
"check": "npm run typecheck && npm test && npm run test:coverage",
|
|
141
145
|
"prepack": "npm run check"
|
|
142
146
|
},
|