@awell-health/awell-extensions 2.0.144 → 2.0.146

Sign up to get free protection for your applications and to get access to all the features.
Files changed (133) hide show
  1. package/dist/extensions/elation/actions/findAppointmentsByPrompt/findAppointmentsByPrompt.js +16 -5
  2. package/dist/extensions/elation/actions/findAppointmentsByPrompt/findAppointmentsByPrompt.js.map +1 -1
  3. package/dist/extensions/elation/actions/updatePatientTags/updatePatientTags.js +11 -3
  4. package/dist/extensions/elation/actions/updatePatientTags/updatePatientTags.js.map +1 -1
  5. package/dist/extensions/epic/actions/createClinicalNote/__testdata__/CreateClinicalNote.mock.d.ts +8 -0
  6. package/dist/extensions/epic/actions/createClinicalNote/__testdata__/CreateClinicalNote.mock.js +12 -0
  7. package/dist/extensions/epic/actions/createClinicalNote/__testdata__/CreateClinicalNote.mock.js.map +1 -0
  8. package/dist/extensions/epic/actions/createClinicalNote/config/datapoints.d.ts +6 -1
  9. package/dist/extensions/epic/actions/createClinicalNote/config/datapoints.js +6 -1
  10. package/dist/extensions/epic/actions/createClinicalNote/config/datapoints.js.map +1 -1
  11. package/dist/extensions/epic/actions/createClinicalNote/config/fields.d.ts +66 -2
  12. package/dist/extensions/epic/actions/createClinicalNote/config/fields.js +56 -2
  13. package/dist/extensions/epic/actions/createClinicalNote/config/fields.js.map +1 -1
  14. package/dist/extensions/epic/actions/createClinicalNote/createClinicalNote.js +66 -1
  15. package/dist/extensions/epic/actions/createClinicalNote/createClinicalNote.js.map +1 -1
  16. package/dist/extensions/epic/actions/createPatient/__testdata__/CreateFhirPatient.mock.d.ts +8 -0
  17. package/dist/extensions/epic/actions/createPatient/__testdata__/CreateFhirPatient.mock.js +12 -0
  18. package/dist/extensions/epic/actions/createPatient/__testdata__/CreateFhirPatient.mock.js.map +1 -0
  19. package/dist/extensions/epic/actions/createPatient/config/datapoints.d.ts +6 -1
  20. package/dist/extensions/epic/actions/createPatient/config/datapoints.js +6 -1
  21. package/dist/extensions/epic/actions/createPatient/config/datapoints.js.map +1 -1
  22. package/dist/extensions/epic/actions/createPatient/config/fields.d.ts +70 -2
  23. package/dist/extensions/epic/actions/createPatient/config/fields.js +61 -2
  24. package/dist/extensions/epic/actions/createPatient/config/fields.js.map +1 -1
  25. package/dist/extensions/epic/actions/createPatient/createPatient.js +61 -1
  26. package/dist/extensions/epic/actions/createPatient/createPatient.js.map +1 -1
  27. package/dist/extensions/epic/actions/getAppointment/__testdata__/GetAppointment.mock.d.ts +52 -0
  28. package/dist/extensions/epic/actions/getAppointment/__testdata__/GetAppointment.mock.js +94 -0
  29. package/dist/extensions/epic/actions/getAppointment/__testdata__/GetAppointment.mock.js.map +1 -0
  30. package/dist/extensions/epic/actions/getAppointment/config/datapoints.d.ts +22 -1
  31. package/dist/extensions/epic/actions/getAppointment/config/datapoints.js +22 -1
  32. package/dist/extensions/epic/actions/getAppointment/config/datapoints.js.map +1 -1
  33. package/dist/extensions/epic/actions/getAppointment/config/fields.d.ts +17 -2
  34. package/dist/extensions/epic/actions/getAppointment/config/fields.js +13 -2
  35. package/dist/extensions/epic/actions/getAppointment/config/fields.js.map +1 -1
  36. package/dist/extensions/epic/actions/getAppointment/getAppointment.js +38 -1
  37. package/dist/extensions/epic/actions/getAppointment/getAppointment.js.map +1 -1
  38. package/dist/extensions/epic/actions/getPatient/__testdata__/FhirPatient.mock.d.ts +90 -0
  39. package/dist/extensions/epic/actions/getPatient/__testdata__/FhirPatient.mock.js +189 -0
  40. package/dist/extensions/epic/actions/getPatient/__testdata__/FhirPatient.mock.js.map +1 -0
  41. package/dist/extensions/epic/actions/getPatient/config/datapoints.d.ts +6 -1
  42. package/dist/extensions/epic/actions/getPatient/config/datapoints.js +6 -1
  43. package/dist/extensions/epic/actions/getPatient/config/datapoints.js.map +1 -1
  44. package/dist/extensions/epic/actions/getPatient/config/fields.d.ts +17 -2
  45. package/dist/extensions/epic/actions/getPatient/config/fields.js +13 -2
  46. package/dist/extensions/epic/actions/getPatient/config/fields.js.map +1 -1
  47. package/dist/extensions/epic/actions/getPatient/getPatient.js +31 -1
  48. package/dist/extensions/epic/actions/getPatient/getPatient.js.map +1 -1
  49. package/dist/extensions/epic/actions/index.d.ts +296 -4
  50. package/dist/extensions/epic/actions/index.js +2 -0
  51. package/dist/extensions/epic/actions/index.js.map +1 -1
  52. package/dist/extensions/epic/actions/matchPatient/__testdata__/FhirPatientMatch.mock.d.ts +114 -0
  53. package/dist/extensions/epic/actions/matchPatient/__testdata__/FhirPatientMatch.mock.js +221 -0
  54. package/dist/extensions/epic/actions/matchPatient/__testdata__/FhirPatientMatch.mock.js.map +1 -0
  55. package/dist/extensions/epic/actions/matchPatient/__testdata__/FhirPatientNoMatch.mock.d.ts +14 -0
  56. package/dist/extensions/epic/actions/matchPatient/__testdata__/FhirPatientNoMatch.mock.js +22 -0
  57. package/dist/extensions/epic/actions/matchPatient/__testdata__/FhirPatientNoMatch.mock.js.map +1 -0
  58. package/dist/extensions/epic/actions/matchPatient/__testdata__/index.d.ts +2 -0
  59. package/dist/extensions/epic/actions/matchPatient/__testdata__/index.js +19 -0
  60. package/dist/extensions/epic/actions/matchPatient/__testdata__/index.js.map +1 -0
  61. package/dist/extensions/epic/actions/matchPatient/config/datapoints.d.ts +6 -0
  62. package/dist/extensions/epic/actions/matchPatient/config/datapoints.js +10 -0
  63. package/dist/extensions/epic/actions/matchPatient/config/datapoints.js.map +1 -0
  64. package/dist/extensions/epic/actions/matchPatient/config/fields.d.ts +61 -0
  65. package/dist/extensions/epic/actions/matchPatient/config/fields.js +58 -0
  66. package/dist/extensions/epic/actions/matchPatient/config/fields.js.map +1 -0
  67. package/dist/extensions/epic/actions/matchPatient/config/index.d.ts +2 -0
  68. package/dist/extensions/epic/actions/matchPatient/config/index.js +9 -0
  69. package/dist/extensions/epic/actions/matchPatient/config/index.js.map +1 -0
  70. package/dist/extensions/epic/actions/matchPatient/index.d.ts +1 -0
  71. package/dist/extensions/epic/actions/matchPatient/index.js +6 -0
  72. package/dist/extensions/epic/actions/matchPatient/index.js.map +1 -0
  73. package/dist/extensions/epic/actions/matchPatient/matchPatient.d.ts +4 -0
  74. package/dist/extensions/epic/actions/matchPatient/matchPatient.js +87 -0
  75. package/dist/extensions/epic/actions/matchPatient/matchPatient.js.map +1 -0
  76. package/dist/extensions/epic/lib/api/FhirR4/FhirR4client.d.ts +26 -0
  77. package/dist/extensions/epic/lib/api/FhirR4/FhirR4client.js +121 -0
  78. package/dist/extensions/epic/lib/api/FhirR4/FhirR4client.js.map +1 -0
  79. package/dist/extensions/epic/lib/api/FhirR4/index.d.ts +1 -0
  80. package/dist/extensions/epic/lib/api/FhirR4/index.js +18 -0
  81. package/dist/extensions/epic/lib/api/FhirR4/index.js.map +1 -0
  82. package/dist/extensions/epic/lib/api/FhirR4/schema/AppointmentRead.schema.d.ts +9 -0
  83. package/dist/extensions/epic/lib/api/FhirR4/schema/AppointmentRead.schema.js +6 -0
  84. package/dist/extensions/epic/lib/api/FhirR4/schema/AppointmentRead.schema.js.map +1 -0
  85. package/dist/extensions/epic/lib/api/FhirR4/schema/DocumentReferenceCreate.schema.d.ts +7 -0
  86. package/dist/extensions/epic/lib/api/FhirR4/schema/DocumentReferenceCreate.schema.js +3 -0
  87. package/dist/extensions/epic/lib/api/FhirR4/schema/DocumentReferenceCreate.schema.js.map +1 -0
  88. package/dist/extensions/epic/lib/api/FhirR4/schema/PatientCreate.schema.d.ts +7 -0
  89. package/dist/extensions/epic/lib/api/FhirR4/schema/PatientCreate.schema.js +3 -0
  90. package/dist/extensions/epic/lib/api/FhirR4/schema/PatientCreate.schema.js.map +1 -0
  91. package/dist/extensions/epic/lib/api/FhirR4/schema/PatientMatch.schema.d.ts +37 -0
  92. package/dist/extensions/epic/lib/api/FhirR4/schema/PatientMatch.schema.js +3 -0
  93. package/dist/extensions/epic/lib/api/FhirR4/schema/PatientMatch.schema.js.map +1 -0
  94. package/dist/extensions/epic/lib/api/FhirR4/schema/PatientRead.schema.d.ts +9 -0
  95. package/dist/extensions/epic/lib/api/FhirR4/schema/PatientRead.schema.js +6 -0
  96. package/dist/extensions/epic/lib/api/FhirR4/schema/PatientRead.schema.js.map +1 -0
  97. package/dist/extensions/epic/lib/api/FhirR4/schema/index.d.ts +5 -0
  98. package/dist/extensions/epic/lib/api/FhirR4/schema/index.js +22 -0
  99. package/dist/extensions/epic/lib/api/FhirR4/schema/index.js.map +1 -0
  100. package/dist/extensions/epic/lib/api/auth/generateJWT/generateJWT.d.ts +8 -0
  101. package/dist/extensions/epic/lib/api/auth/generateJWT/generateJWT.js +38 -0
  102. package/dist/extensions/epic/lib/api/auth/generateJWT/generateJWT.js.map +1 -0
  103. package/dist/extensions/epic/lib/api/auth/generateJWT/index.d.ts +1 -0
  104. package/dist/extensions/epic/lib/api/auth/generateJWT/index.js +18 -0
  105. package/dist/extensions/epic/lib/api/auth/generateJWT/index.js.map +1 -0
  106. package/dist/extensions/epic/lib/api/schemas/Appointment/Status.schema.d.ts +2 -0
  107. package/dist/extensions/epic/lib/api/schemas/Appointment/Status.schema.js +17 -0
  108. package/dist/extensions/epic/lib/api/schemas/Appointment/Status.schema.js.map +1 -0
  109. package/dist/extensions/epic/lib/api/schemas/Appointment/index.d.ts +1 -0
  110. package/dist/extensions/epic/lib/api/schemas/Appointment/index.js +18 -0
  111. package/dist/extensions/epic/lib/api/schemas/Appointment/index.js.map +1 -0
  112. package/dist/extensions/epic/lib/api/schemas/DocumentReference/Status.schema.d.ts +2 -0
  113. package/dist/extensions/epic/lib/api/schemas/DocumentReference/Status.schema.js +6 -0
  114. package/dist/extensions/epic/lib/api/schemas/DocumentReference/Status.schema.js.map +1 -0
  115. package/dist/extensions/epic/lib/api/schemas/DocumentReference/Type.schema.d.ts +9 -0
  116. package/dist/extensions/epic/lib/api/schemas/DocumentReference/Type.schema.js +28 -0
  117. package/dist/extensions/epic/lib/api/schemas/DocumentReference/Type.schema.js.map +1 -0
  118. package/dist/extensions/epic/lib/api/schemas/DocumentReference/index.d.ts +2 -0
  119. package/dist/extensions/epic/lib/api/schemas/DocumentReference/index.js +19 -0
  120. package/dist/extensions/epic/lib/api/schemas/DocumentReference/index.js.map +1 -0
  121. package/dist/extensions/epic/lib/api/schemas/Patient/Gender.schema.d.ts +2 -0
  122. package/dist/extensions/epic/lib/api/schemas/Patient/Gender.schema.js +6 -0
  123. package/dist/extensions/epic/lib/api/schemas/Patient/Gender.schema.js.map +1 -0
  124. package/dist/extensions/epic/lib/api/schemas/Patient/index.d.ts +1 -0
  125. package/dist/extensions/epic/lib/api/schemas/Patient/index.js +18 -0
  126. package/dist/extensions/epic/lib/api/schemas/Patient/index.js.map +1 -0
  127. package/dist/extensions/epic/lib/validatePayloadAndCreateSdks.d.ts +18 -0
  128. package/dist/extensions/epic/lib/validatePayloadAndCreateSdks.js +31 -0
  129. package/dist/extensions/epic/lib/validatePayloadAndCreateSdks.js.map +1 -0
  130. package/dist/extensions/epic/settings.d.ts +46 -2
  131. package/dist/extensions/epic/settings.js +36 -2
  132. package/dist/extensions/epic/settings.js.map +1 -1
  133. package/package.json +3 -1
@@ -0,0 +1,87 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.matchPatient = void 0;
4
+ const extensions_core_1 = require("@awell-health/extensions-core");
5
+ const config_1 = require("./config");
6
+ const validatePayloadAndCreateSdks_1 = require("../../lib/validatePayloadAndCreateSdks");
7
+ const lodash_1 = require("lodash");
8
+ const axios_1 = require("axios");
9
+ const awell_1 = require("../../../../src/lib/awell");
10
+ exports.matchPatient = {
11
+ key: 'matchPatient',
12
+ category: extensions_core_1.Category.EHR_INTEGRATIONS,
13
+ title: 'Match patient',
14
+ description: 'Match patient to existing patient in Epic',
15
+ fields: config_1.fields,
16
+ previewable: false,
17
+ dataPoints: config_1.dataPoints,
18
+ onEvent: async ({ payload, onComplete, onError }) => {
19
+ var _a;
20
+ const { epicFhirR4Sdk, fields: { familyName, givenName, birthDate, gender, email }, } = await (0, validatePayloadAndCreateSdks_1.validatePayloadAndCreateSdks)({
21
+ fieldsSchema: config_1.FieldsValidationSchema,
22
+ payload,
23
+ });
24
+ /**
25
+ * Matching by SSN is not allowed due to security reasons.
26
+ */
27
+ const patientMatchInput = {
28
+ resourceType: 'Parameters',
29
+ parameter: [
30
+ {
31
+ name: 'resource',
32
+ resource: {
33
+ resourceType: 'Patient',
34
+ name: [
35
+ {
36
+ family: familyName,
37
+ given: [givenName],
38
+ },
39
+ ],
40
+ birthDate: birthDate.toISOString().split('T')[0],
41
+ gender,
42
+ ...(!(0, lodash_1.isEmpty)(email) && {
43
+ telecom: [
44
+ {
45
+ system: 'email',
46
+ value: email,
47
+ },
48
+ ],
49
+ }),
50
+ },
51
+ },
52
+ {
53
+ name: 'onlyCertainMatches',
54
+ valueBoolean: 'true',
55
+ },
56
+ ],
57
+ };
58
+ try {
59
+ const { data } = await epicFhirR4Sdk.matchPatient(patientMatchInput);
60
+ const matchCount = data.total;
61
+ if (matchCount !== 1) {
62
+ throw new Error('No match found');
63
+ }
64
+ await onComplete({
65
+ data_points: {
66
+ resourceId: data.entry[0].resource.id,
67
+ },
68
+ });
69
+ }
70
+ catch (error) {
71
+ if (error instanceof axios_1.AxiosError) {
72
+ const err = error;
73
+ await onError({
74
+ events: [
75
+ (0, awell_1.addActivityEventLog)({
76
+ message: JSON.stringify((_a = err.response) === null || _a === void 0 ? void 0 : _a.data, null, 2),
77
+ }),
78
+ ],
79
+ });
80
+ return;
81
+ }
82
+ // Throw all other errors
83
+ throw error;
84
+ }
85
+ },
86
+ };
87
+ //# sourceMappingURL=matchPatient.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"matchPatient.js","sourceRoot":"","sources":["../../../../../extensions/epic/actions/matchPatient/matchPatient.ts"],"names":[],"mappings":";;;AAAA,mEAAqE;AAErE,qCAAqE;AACrE,yFAAqF;AAErF,mCAAgC;AAChC,iCAAkC;AAClC,qDAA+D;AAElD,QAAA,YAAY,GAIrB;IACF,GAAG,EAAE,cAAc;IACnB,QAAQ,EAAE,0BAAQ,CAAC,gBAAgB;IACnC,KAAK,EAAE,eAAe;IACtB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,CAAC,CAAA;YACnC,CAAC;YAED,MAAM,UAAU,CAAC;gBACf,WAAW,EAAE;oBACX,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE;iBACtC;aACF,CAAC,CAAA;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,KAAK,YAAY,kBAAU,EAAE,CAAC;gBAChC,MAAM,GAAG,GAAG,KAAmB,CAAA;gBAC/B,MAAM,OAAO,CAAC;oBACZ,MAAM,EAAE;wBACN,IAAA,2BAAmB,EAAC;4BAClB,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,MAAA,GAAG,CAAC,QAAQ,0CAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;yBACrD,CAAC;qBACH;iBACF,CAAC,CAAA;gBACF,OAAM;YACR,CAAC;YAED,yBAAyB;YACzB,MAAM,KAAK,CAAA;QACb,CAAC;IACH,CAAC;CACF,CAAA"}
@@ -0,0 +1,26 @@
1
+ import { type AxiosResponse } from 'axios';
2
+ import { type PatientReadInputType, type PatientReadResponseType, type PatientCreateInputType, type PatientCreateResponseType, type PatientMatchInputType, type PatientMatchResponseType, type DocumentReferenceCreateInputType, type DocumentReferenceCreateResponseType, type AppointmentReadResponseType, type AppointmentReadInputType } from './schema';
3
+ /**
4
+ * FHIR R4 API Client
5
+ */
6
+ export declare class EpicFhirR4Client {
7
+ private readonly client;
8
+ private readonly authUrl;
9
+ private readonly clientId;
10
+ private readonly privateKey;
11
+ private accessToken;
12
+ private tokenExpiry;
13
+ constructor({ baseUrl, authUrl, clientId, privateKey, }: {
14
+ baseUrl: string;
15
+ authUrl: string;
16
+ clientId: string;
17
+ privateKey: string;
18
+ });
19
+ private refreshAccessToken;
20
+ private isTokenExpired;
21
+ getPatient(resourceId: PatientReadInputType): Promise<AxiosResponse<PatientReadResponseType>>;
22
+ createPatient(data: PatientCreateInputType): Promise<AxiosResponse<PatientCreateResponseType>>;
23
+ matchPatient(data: PatientMatchInputType): Promise<AxiosResponse<PatientMatchResponseType>>;
24
+ createDocumentReference(data: DocumentReferenceCreateInputType): Promise<AxiosResponse<DocumentReferenceCreateResponseType>>;
25
+ getAppointment(resourceId: AppointmentReadInputType): Promise<AxiosResponse<AppointmentReadResponseType>>;
26
+ }
@@ -0,0 +1,121 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.EpicFhirR4Client = void 0;
37
+ const axios_1 = __importStar(require("axios"));
38
+ const lodash_1 = require("lodash");
39
+ const generateJWT_1 = require("../auth/generateJWT");
40
+ /**
41
+ * FHIR R4 API Client
42
+ */
43
+ class EpicFhirR4Client {
44
+ constructor({ baseUrl, authUrl, clientId, privateKey, }) {
45
+ this.accessToken = null;
46
+ this.tokenExpiry = null; // Store token expiry time in UNIX timestamp
47
+ this.authUrl = authUrl;
48
+ this.clientId = clientId;
49
+ this.privateKey = privateKey;
50
+ this.client = axios_1.default.create({
51
+ baseURL: new URL('FHIR/R4/', baseUrl).toString(),
52
+ headers: new axios_1.AxiosHeaders({
53
+ 'Content-Type': 'application/json',
54
+ }),
55
+ });
56
+ this.client.interceptors.request.use(async (config) => {
57
+ var _a;
58
+ if ((0, lodash_1.isNil)(this.accessToken) || this.isTokenExpired()) {
59
+ await this.refreshAccessToken();
60
+ }
61
+ // Add the Authorization header to the request
62
+ if (!(0, lodash_1.isNil)(this.accessToken)) {
63
+ config.headers = axios_1.AxiosHeaders.from((_a = config === null || config === void 0 ? void 0 : config.headers) !== null && _a !== void 0 ? _a : {});
64
+ config.headers.set('Authorization', `Bearer ${this.accessToken}`);
65
+ }
66
+ return config;
67
+ });
68
+ }
69
+ async refreshAccessToken() {
70
+ try {
71
+ const tokenResponse = await axios_1.default.post(this.authUrl, {
72
+ grant_type: 'client_credentials',
73
+ client_assertion_type: 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer',
74
+ client_assertion: (0, generateJWT_1.generateJWT)(this.clientId, this.authUrl, this.privateKey),
75
+ }, {
76
+ headers: {
77
+ 'Content-Type': 'application/x-www-form-urlencoded',
78
+ },
79
+ });
80
+ this.accessToken = tokenResponse.data.access_token;
81
+ this.tokenExpiry =
82
+ Math.floor(Date.now() / 1000) + tokenResponse.data.expires_in; // Current time + expiry
83
+ }
84
+ catch (error) {
85
+ console.error('Failed to refresh access token:', error);
86
+ throw new Error('Unable to refresh access token');
87
+ }
88
+ }
89
+ isTokenExpired() {
90
+ const now = Math.floor(Date.now() / 1000); // Current time in seconds
91
+ return ((0, lodash_1.isNil)(this.tokenExpiry) || now >= this.tokenExpiry - 60 // Refresh 1 minute before expiry
92
+ );
93
+ }
94
+ async getPatient(resourceId) {
95
+ const url = new URL(`Patient/${resourceId}`, this.client.defaults.baseURL);
96
+ const response = await this.client.get(url.toString());
97
+ return response;
98
+ }
99
+ async createPatient(data) {
100
+ const url = new URL(`Patient`, this.client.defaults.baseURL);
101
+ const response = await this.client.post(url.toString(), data);
102
+ return response;
103
+ }
104
+ async matchPatient(data) {
105
+ const url = new URL(`Patient/$match`, this.client.defaults.baseURL);
106
+ const response = await this.client.post(url.toString(), data);
107
+ return response;
108
+ }
109
+ async createDocumentReference(data) {
110
+ const url = new URL(`DocumentReference`, this.client.defaults.baseURL);
111
+ const response = await this.client.post(url.toString(), data);
112
+ return response;
113
+ }
114
+ async getAppointment(resourceId) {
115
+ const url = new URL(`Appointment/${resourceId}`, this.client.defaults.baseURL);
116
+ const response = await this.client.get(url.toString());
117
+ return response;
118
+ }
119
+ }
120
+ exports.EpicFhirR4Client = EpicFhirR4Client;
121
+ //# sourceMappingURL=FhirR4client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FhirR4client.js","sourceRoot":"","sources":["../../../../../../extensions/epic/lib/api/FhirR4/FhirR4client.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAKc;AAad,mCAA8B;AAC9B,qDAAiD;AAEjD;;GAEG;AACH,MAAa,gBAAgB;IAS3B,YAAY,EACV,OAAO,EACP,OAAO,EACP,QAAQ,EACR,UAAU,GAMX;QAbO,gBAAW,GAAkB,IAAI,CAAA;QACjC,gBAAW,GAAkB,IAAI,CAAA,CAAC,4CAA4C;QAapF,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;QACxB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAE5B,IAAI,CAAC,MAAM,GAAG,eAAK,CAAC,MAAM,CAAC;YACzB,OAAO,EAAE,IAAI,GAAG,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC,QAAQ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IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAA;QAEnE,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CACrC,GAAG,CAAC,QAAQ,EAAE,EACd,IAAI,CACL,CAAA;QAED,OAAO,QAAQ,CAAA;IACjB,CAAC;IAED,KAAK,CAAC,uBAAuB,CAC3B,IAAsC;QAEtC,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,mBAAmB,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAA;QAEtE,MAAM,QAAQ,GACZ,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CACpB,GAAG,CAAC,QAAQ,EAAE,EACd,IAAI,CACL,CAAA;QAEH,OAAO,QAAQ,CAAA;IACjB,CAAC;IAED,KAAK,CAAC,cAAc,CAClB,UAAoC;QAEpC,MAAM,GAAG,GAAG,IAAI,GAAG,CACjB,eAAe,UAAU,EAAE,EAC3B,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAC7B,CAAA;QAED,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CACpC,GAAG,CAAC,QAAQ,EAAE,CACf,CAAA;QAED,OAAO,QAAQ,CAAA;IACjB,CAAC;CACF;AA7JD,4CA6JC"}
@@ -0,0 +1 @@
1
+ export * from './FhirR4client';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./FhirR4client"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../extensions/epic/lib/api/FhirR4/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA8B"}
@@ -0,0 +1,9 @@
1
+ import { z } from 'zod';
2
+ import { type Appointment } from '@medplum/fhirtypes';
3
+ export declare const AppointmentReadInputSchema: z.ZodString;
4
+ export type AppointmentReadInputType = z.infer<typeof AppointmentReadInputSchema>;
5
+ /**
6
+ * This is probably imperfect as Medplum's FHIR type might
7
+ * not be fully compatible with Epic's FHIR type but good enough for now
8
+ */
9
+ export type AppointmentReadResponseType = Appointment;
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AppointmentReadInputSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.AppointmentReadInputSchema = zod_1.z.string();
6
+ //# sourceMappingURL=AppointmentRead.schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AppointmentRead.schema.js","sourceRoot":"","sources":["../../../../../../../extensions/epic/lib/api/FhirR4/schema/AppointmentRead.schema.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AAGV,QAAA,0BAA0B,GAAG,OAAC,CAAC,MAAM,EAAE,CAAA"}
@@ -0,0 +1,7 @@
1
+ import { type DocumentReference } from '@medplum/fhirtypes';
2
+ /**
3
+ * This is probably imperfect as Medplum's FHIR type might
4
+ * not be fully compatible with Epic's FHIR type but good enough for now
5
+ */
6
+ export type DocumentReferenceCreateInputType = Partial<DocumentReference>;
7
+ export type DocumentReferenceCreateResponseType = DocumentReference;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=DocumentReferenceCreate.schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DocumentReferenceCreate.schema.js","sourceRoot":"","sources":["../../../../../../../extensions/epic/lib/api/FhirR4/schema/DocumentReferenceCreate.schema.ts"],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
1
+ import { type Patient } from '@medplum/fhirtypes';
2
+ /**
3
+ * This is probably imperfect as Medplum's FHIR type might
4
+ * not be fully compatible with Epic's FHIR type but good enough for now
5
+ */
6
+ export type PatientCreateInputType = Partial<Patient>;
7
+ export type PatientCreateResponseType = Patient;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=PatientCreate.schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PatientCreate.schema.js","sourceRoot":"","sources":["../../../../../../../extensions/epic/lib/api/FhirR4/schema/PatientCreate.schema.ts"],"names":[],"mappings":""}
@@ -0,0 +1,37 @@
1
+ import { type Patient } from '@medplum/fhirtypes';
2
+ export interface PatientMatchInputType {
3
+ resourceType: 'Parameters';
4
+ parameter: [
5
+ {
6
+ name: 'resource';
7
+ resource: Partial<Patient>;
8
+ },
9
+ {
10
+ name: 'onlyCertainMatches';
11
+ valueBoolean: 'true' | 'false';
12
+ }
13
+ ];
14
+ }
15
+ export interface PatientMatchResponseType {
16
+ resourceType: 'Bundle';
17
+ type: 'searchset';
18
+ total: number;
19
+ link: unknown;
20
+ entry: [
21
+ {
22
+ link: unknown;
23
+ fullUrl: string;
24
+ resource: Partial<Patient>;
25
+ search: {
26
+ extension: [
27
+ {
28
+ valueCode: 'certain' | 'probable' | 'possible' | 'certainly-not';
29
+ url: 'http://hl7.org/fhir/StructureDefinition/match-grade';
30
+ }
31
+ ];
32
+ mode: 'match';
33
+ score: number;
34
+ };
35
+ }
36
+ ];
37
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=PatientMatch.schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PatientMatch.schema.js","sourceRoot":"","sources":["../../../../../../../extensions/epic/lib/api/FhirR4/schema/PatientMatch.schema.ts"],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ import { z } from 'zod';
2
+ import { type Patient } from '@medplum/fhirtypes';
3
+ export declare const PatientReadInputSchema: z.ZodString;
4
+ export type PatientReadInputType = z.infer<typeof PatientReadInputSchema>;
5
+ /**
6
+ * This is probably imperfect as Medplum's FHIR type might
7
+ * not be fully compatible with Epic's FHIR type but good enough for now
8
+ */
9
+ export type PatientReadResponseType = Patient;
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PatientReadInputSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.PatientReadInputSchema = zod_1.z.string();
6
+ //# sourceMappingURL=PatientRead.schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PatientRead.schema.js","sourceRoot":"","sources":["../../../../../../../extensions/epic/lib/api/FhirR4/schema/PatientRead.schema.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AAGV,QAAA,sBAAsB,GAAG,OAAC,CAAC,MAAM,EAAE,CAAA"}
@@ -0,0 +1,5 @@
1
+ export * from './PatientRead.schema';
2
+ export * from './PatientCreate.schema';
3
+ export * from './PatientMatch.schema';
4
+ export * from './DocumentReferenceCreate.schema';
5
+ export * from './AppointmentRead.schema';
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./PatientRead.schema"), exports);
18
+ __exportStar(require("./PatientCreate.schema"), exports);
19
+ __exportStar(require("./PatientMatch.schema"), exports);
20
+ __exportStar(require("./DocumentReferenceCreate.schema"), exports);
21
+ __exportStar(require("./AppointmentRead.schema"), exports);
22
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../extensions/epic/lib/api/FhirR4/schema/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAoC;AACpC,yDAAsC;AACtC,wDAAqC;AACrC,mEAAgD;AAChD,2DAAwC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Generates a JWT for Epic's FHIR integration.
3
+ * @param clientId - The client ID for the app.
4
+ * @param tokenEndpoint - The FHIR authorization server's token endpoint URL.
5
+ * @param privateKey - The private key to sign the JWT.
6
+ * @returns The signed JWT.
7
+ */
8
+ export declare const generateJWT: (clientId: string, tokenEndpoint: string, privateKey: string) => string;
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.generateJWT = void 0;
7
+ const crypto_1 = require("crypto");
8
+ const jsonwebtoken_1 = __importDefault(require("jsonwebtoken"));
9
+ /**
10
+ * Generates a JWT for Epic's FHIR integration.
11
+ * @param clientId - The client ID for the app.
12
+ * @param tokenEndpoint - The FHIR authorization server's token endpoint URL.
13
+ * @param privateKey - The private key to sign the JWT.
14
+ * @returns The signed JWT.
15
+ */
16
+ const generateJWT = (clientId, tokenEndpoint, privateKey) => {
17
+ const nowInSeconds = Math.floor(Date.now() / 1000);
18
+ const jwtHeader = {
19
+ alg: 'RS384',
20
+ typ: 'JWT',
21
+ };
22
+ const jwtPayload = {
23
+ iss: clientId,
24
+ sub: clientId,
25
+ aud: tokenEndpoint,
26
+ jti: (0, crypto_1.randomUUID)(),
27
+ exp: nowInSeconds + 300, // 5 minutes in the future
28
+ nbf: nowInSeconds,
29
+ iat: nowInSeconds,
30
+ };
31
+ const token = jsonwebtoken_1.default.sign(jwtPayload, privateKey, {
32
+ algorithm: 'RS384',
33
+ header: jwtHeader,
34
+ });
35
+ return token;
36
+ };
37
+ exports.generateJWT = generateJWT;
38
+ //# sourceMappingURL=generateJWT.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generateJWT.js","sourceRoot":"","sources":["../../../../../../../extensions/epic/lib/api/auth/generateJWT/generateJWT.ts"],"names":[],"mappings":";;;;;;AAAA,mCAAmC;AACnC,gEAA8B;AAE9B;;;;;;GAMG;AACI,MAAM,WAAW,GAAG,CACzB,QAAgB,EAChB,aAAqB,EACrB,UAAkB,EACV,EAAE;IACV,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAA;IAClD,MAAM,SAAS,GAAG;QAChB,GAAG,EAAE,OAAO;QACZ,GAAG,EAAE,KAAK;KACX,CAAA;IAED,MAAM,UAAU,GAAG;QACjB,GAAG,EAAE,QAAQ;QACb,GAAG,EAAE,QAAQ;QACb,GAAG,EAAE,aAAa;QAClB,GAAG,EAAE,IAAA,mBAAU,GAAE;QACjB,GAAG,EAAE,YAAY,GAAG,GAAG,EAAE,0BAA0B;QACnD,GAAG,EAAE,YAAY;QACjB,GAAG,EAAE,YAAY;KAClB,CAAA;IAED,MAAM,KAAK,GAAG,sBAAG,CAAC,IAAI,CAAC,UAAU,EAAE,UAAU,EAAE;QAC7C,SAAS,EAAE,OAAO;QAClB,MAAM,EAAE,SAAS;KAClB,CAAC,CAAA;IAEF,OAAO,KAAK,CAAA;AACd,CAAC,CAAA;AA3BY,QAAA,WAAW,eA2BvB"}
@@ -0,0 +1 @@
1
+ export * from './generateJWT';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./generateJWT"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../extensions/epic/lib/api/auth/generateJWT/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA6B"}
@@ -0,0 +1,2 @@
1
+ import { z } from 'zod';
2
+ export declare const StatusSchema: z.ZodEnum<["proposed", "pending", "booked", "arrived", "fulfilled", "cancelled", "noshow", "entered-in-error", "checked-in", "waitlist"]>;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StatusSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.StatusSchema = zod_1.z.enum([
6
+ 'proposed',
7
+ 'pending',
8
+ 'booked',
9
+ 'arrived',
10
+ 'fulfilled',
11
+ 'cancelled',
12
+ 'noshow',
13
+ 'entered-in-error',
14
+ 'checked-in',
15
+ 'waitlist',
16
+ ]);
17
+ //# sourceMappingURL=Status.schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Status.schema.js","sourceRoot":"","sources":["../../../../../../../extensions/epic/lib/api/schemas/Appointment/Status.schema.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AAEV,QAAA,YAAY,GAAG,OAAC,CAAC,IAAI,CAAC;IACjC,UAAU;IACV,SAAS;IACT,QAAQ;IACR,SAAS;IACT,WAAW;IACX,WAAW;IACX,QAAQ;IACR,kBAAkB;IAClB,YAAY;IACZ,UAAU;CACX,CAAC,CAAA"}
@@ -0,0 +1 @@
1
+ export * from './Status.schema';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./Status.schema"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../extensions/epic/lib/api/schemas/Appointment/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAA+B"}
@@ -0,0 +1,2 @@
1
+ import { z } from 'zod';
2
+ export declare const StatusSchema: z.ZodEnum<["final", "preliminary"]>;
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StatusSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.StatusSchema = zod_1.z.enum(['final', 'preliminary']);
6
+ //# sourceMappingURL=Status.schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Status.schema.js","sourceRoot":"","sources":["../../../../../../../extensions/epic/lib/api/schemas/DocumentReference/Status.schema.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AAEV,QAAA,YAAY,GAAG,OAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC,CAAA"}
@@ -0,0 +1,9 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * See https://fhir.epic.com/Sandbox?api=1046
4
+ */
5
+ export declare const TypeSchema: z.ZodEnum<["Progress Note", "Consult Note", "Procedure Note", "H&P Note", "Discharge Summary", "ED Note", "Patient Instructions", "Nursing Note"]>;
6
+ export declare const LoincCodeTypesDictionary: Record<z.infer<typeof TypeSchema>, {
7
+ code: string;
8
+ label: string;
9
+ }>;
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LoincCodeTypesDictionary = exports.TypeSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ /**
6
+ * See https://fhir.epic.com/Sandbox?api=1046
7
+ */
8
+ exports.TypeSchema = zod_1.z.enum([
9
+ 'Progress Note',
10
+ 'Consult Note',
11
+ 'Procedure Note',
12
+ 'H&P Note',
13
+ 'Discharge Summary',
14
+ 'ED Note',
15
+ 'Patient Instructions',
16
+ 'Nursing Note',
17
+ ]);
18
+ exports.LoincCodeTypesDictionary = {
19
+ 'Progress Note': { code: '11506-3', label: 'Progress Note' },
20
+ 'Consult Note': { code: '11488-4', label: 'Consult Note' },
21
+ 'Procedure Note': { code: '28570-0', label: 'Procedure Note' },
22
+ 'H&P Note': { code: '34117-2', label: 'H&P Note' },
23
+ 'Discharge Summary': { code: '18842-5', label: 'Discharge Summary' },
24
+ 'ED Note': { code: '34111-5', label: 'ED Note' },
25
+ 'Patient Instructions': { code: '69730-0', label: 'Patient Instructions' },
26
+ 'Nursing Note': { code: '34746-8', label: 'Nursing Note' },
27
+ };
28
+ //# sourceMappingURL=Type.schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Type.schema.js","sourceRoot":"","sources":["../../../../../../../extensions/epic/lib/api/schemas/DocumentReference/Type.schema.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AAEvB;;GAEG;AACU,QAAA,UAAU,GAAG,OAAC,CAAC,IAAI,CAAC;IAC/B,eAAe;IACf,cAAc;IACd,gBAAgB;IAChB,UAAU;IACV,mBAAmB;IACnB,SAAS;IACT,sBAAsB;IACtB,cAAc;CACf,CAAC,CAAA;AAEW,QAAA,wBAAwB,GAGjC;IACF,eAAe,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,eAAe,EAAE;IAC5D,cAAc,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,cAAc,EAAE;IAC1D,gBAAgB,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,gBAAgB,EAAE;IAC9D,UAAU,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE;IAClD,mBAAmB,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,mBAAmB,EAAE;IACpE,SAAS,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE;IAChD,sBAAsB,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,sBAAsB,EAAE;IAC1E,cAAc,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,cAAc,EAAE;CAClD,CAAA"}