@metriport/shared 0.30.0-alpha.1 → 0.30.1

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.
Files changed (25) hide show
  1. package/dist/net/index.d.ts +1 -1
  2. package/dist/net/index.d.ts.map +1 -1
  3. package/dist/net/index.js +3 -1
  4. package/dist/net/index.js.map +1 -1
  5. package/package.json +2 -3
  6. package/dist/interface/external/ehr/practicefusion/allergy.d.ts +0 -16
  7. package/dist/interface/external/ehr/practicefusion/allergy.d.ts.map +0 -1
  8. package/dist/interface/external/ehr/practicefusion/allergy.js +0 -39
  9. package/dist/interface/external/ehr/practicefusion/allergy.js.map +0 -1
  10. package/dist/interface/external/ehr/practicefusion/condition.d.ts +0 -17
  11. package/dist/interface/external/ehr/practicefusion/condition.d.ts.map +0 -1
  12. package/dist/interface/external/ehr/practicefusion/condition.js +0 -13
  13. package/dist/interface/external/ehr/practicefusion/condition.js.map +0 -1
  14. package/dist/interface/external/ehr/practicefusion/fhir-resources.d.ts +0 -8
  15. package/dist/interface/external/ehr/practicefusion/fhir-resources.d.ts.map +0 -1
  16. package/dist/interface/external/ehr/practicefusion/fhir-resources.js +0 -3
  17. package/dist/interface/external/ehr/practicefusion/fhir-resources.js.map +0 -1
  18. package/dist/interface/external/ehr/practicefusion/medication.d.ts +0 -17
  19. package/dist/interface/external/ehr/practicefusion/medication.d.ts.map +0 -1
  20. package/dist/interface/external/ehr/practicefusion/medication.js +0 -13
  21. package/dist/interface/external/ehr/practicefusion/medication.js.map +0 -1
  22. package/dist/interface/external/ehr/practicefusion/write-back.d.ts +0 -47
  23. package/dist/interface/external/ehr/practicefusion/write-back.d.ts.map +0 -1
  24. package/dist/interface/external/ehr/practicefusion/write-back.js +0 -29
  25. package/dist/interface/external/ehr/practicefusion/write-back.js.map +0 -1
@@ -1,4 +1,4 @@
1
- export * from "./axios";
1
+ export { makeAxiosInstance } from "./axios";
2
2
  export * from "./error";
3
3
  export * from "./http";
4
4
  export * from "./retry";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/net/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/net/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC5C,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC"}
package/dist/net/index.js CHANGED
@@ -14,7 +14,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./axios"), exports);
17
+ exports.makeAxiosInstance = void 0;
18
+ var axios_1 = require("./axios");
19
+ Object.defineProperty(exports, "makeAxiosInstance", { enumerable: true, get: function () { return axios_1.makeAxiosInstance; } });
18
20
  __exportStar(require("./error"), exports);
19
21
  __exportStar(require("./http"), exports);
20
22
  __exportStar(require("./retry"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/net/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,0CAAwB;AACxB,yCAAuB;AACvB,0CAAwB;AACxB,wCAAsB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/net/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,iCAA4C;AAAnC,0GAAA,iBAAiB,OAAA;AAC1B,0CAAwB;AACxB,yCAAuB;AACvB,0CAAwB;AACxB,wCAAsB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metriport/shared",
3
- "version": "0.30.0-alpha.1",
3
+ "version": "0.30.1",
4
4
  "description": "Common code shared across packages - by Metriport Inc.",
5
5
  "author": "Metriport Inc. <contact@metriport.com>",
6
6
  "homepage": "https://metriport.com/",
@@ -127,6 +127,5 @@
127
127
  "ts-essentials": "^9.3.1",
128
128
  "ts-jest": "29.1.1",
129
129
  "typescript": "^4.9.5"
130
- },
131
- "gitHead": "bf3e7278e9c9f8c57f52a85009156acefe62b100"
130
+ }
132
131
  }
@@ -1,16 +0,0 @@
1
- import { AllergyIntolerance } from "@medplum/fhirtypes";
2
- export interface AllergyValidationResult {
3
- isValid: boolean;
4
- errors: string[];
5
- }
6
- /**
7
- * Validates an AllergyIntolerance resource for Practice Fusion-specific requirements.
8
- * Use this AFTER AJV validation to check constraints not covered by JSON schema.
9
- *
10
- * Checks:
11
- * - Practice Fusion: code is required (FHIR says 0..1, but PF requires it)
12
- * - FHIR ait-1: clinicalStatus SHALL be present if verificationStatus is not entered-in-error
13
- * - FHIR ait-2: clinicalStatus SHALL NOT be present if verificationStatus is entered-in-error
14
- */
15
- export declare function validateAllergyIntoleranceForWrite(allergy: AllergyIntolerance): AllergyValidationResult;
16
- //# sourceMappingURL=allergy.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"allergy.d.ts","sourceRoot":"","sources":["../../../../../src/interface/external/ehr/practicefusion/allergy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAExD,MAAM,WAAW,uBAAuB;IACpC,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;CACpB;AAED;;;;;;;;GAQG;AACH,wBAAgB,kCAAkC,CAC9C,OAAO,EAAE,kBAAkB,GAC5B,uBAAuB,CAmCzB"}
@@ -1,39 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.validateAllergyIntoleranceForWrite = void 0;
4
- /**
5
- * Validates an AllergyIntolerance resource for Practice Fusion-specific requirements.
6
- * Use this AFTER AJV validation to check constraints not covered by JSON schema.
7
- *
8
- * Checks:
9
- * - Practice Fusion: code is required (FHIR says 0..1, but PF requires it)
10
- * - FHIR ait-1: clinicalStatus SHALL be present if verificationStatus is not entered-in-error
11
- * - FHIR ait-2: clinicalStatus SHALL NOT be present if verificationStatus is entered-in-error
12
- */
13
- function validateAllergyIntoleranceForWrite(allergy) {
14
- const errors = [];
15
- // Practice Fusion requires code (even though FHIR says 0..1)
16
- if (!allergy.code) {
17
- errors.push("code is required (Practice Fusion requirement)");
18
- }
19
- else if (!allergy.code.coding?.length && !allergy.code.text) {
20
- errors.push("code must have at least coding or text");
21
- }
22
- // Check if verificationStatus is entered-in-error
23
- const isEnteredInError = allergy.verificationStatus?.coding?.some(c => c.system === "http://terminology.hl7.org/CodeSystem/allergyintolerance-verification" &&
24
- c.code === "entered-in-error");
25
- // Constraint ait-1: clinicalStatus SHALL be present if verificationStatus is not entered-in-error
26
- if (!isEnteredInError && !allergy.clinicalStatus) {
27
- errors.push("clinicalStatus is required when verificationStatus is not entered-in-error (FHIR ait-1)");
28
- }
29
- // Constraint ait-2: clinicalStatus SHALL NOT be present if verificationStatus is entered-in-error
30
- if (isEnteredInError && allergy.clinicalStatus) {
31
- errors.push("clinicalStatus must not be present when verificationStatus is entered-in-error (FHIR ait-2)");
32
- }
33
- return {
34
- isValid: errors.length === 0,
35
- errors,
36
- };
37
- }
38
- exports.validateAllergyIntoleranceForWrite = validateAllergyIntoleranceForWrite;
39
- //# sourceMappingURL=allergy.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"allergy.js","sourceRoot":"","sources":["../../../../../src/interface/external/ehr/practicefusion/allergy.ts"],"names":[],"mappings":";;;AAOA;;;;;;;;GAQG;AACH,SAAgB,kCAAkC,CAC9C,OAA2B;IAE3B,MAAM,MAAM,GAAa,EAAE,CAAC;IAE5B,6DAA6D;IAC7D,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE;QACf,MAAM,CAAC,IAAI,CAAC,gDAAgD,CAAC,CAAC;KACjE;SAAM,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE;QAC3D,MAAM,CAAC,IAAI,CAAC,wCAAwC,CAAC,CAAC;KACzD;IAED,kDAAkD;IAClD,MAAM,gBAAgB,GAAG,OAAO,CAAC,kBAAkB,EAAE,MAAM,EAAE,IAAI,CAC7D,CAAC,CAAC,EAAE,CACA,CAAC,CAAC,MAAM,KAAK,uEAAuE;QACpF,CAAC,CAAC,IAAI,KAAK,kBAAkB,CACpC,CAAC;IAEF,kGAAkG;IAClG,IAAI,CAAC,gBAAgB,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE;QAC9C,MAAM,CAAC,IAAI,CACP,yFAAyF,CAC5F,CAAC;KACL;IAED,kGAAkG;IAClG,IAAI,gBAAgB,IAAI,OAAO,CAAC,cAAc,EAAE;QAC5C,MAAM,CAAC,IAAI,CACP,6FAA6F,CAChG,CAAC;KACL;IAED,OAAO;QACH,OAAO,EAAE,MAAM,CAAC,MAAM,KAAK,CAAC;QAC5B,MAAM;KACT,CAAC;AACN,CAAC;AArCD,gFAqCC"}
@@ -1,17 +0,0 @@
1
- import { z } from "zod";
2
- /**
3
- * Schema for FHIR Condition response from PracticeFusion.
4
- * PracticeFusion returns the created FHIR resource with an ID.
5
- */
6
- export declare const createdConditionSchema: z.ZodObject<{
7
- resourceType: z.ZodLiteral<"Condition">;
8
- id: z.ZodString;
9
- }, "strip", z.ZodTypeAny, {
10
- resourceType: "Condition";
11
- id: string;
12
- }, {
13
- resourceType: "Condition";
14
- id: string;
15
- }>;
16
- export type CreatedCondition = z.infer<typeof createdConditionSchema>;
17
- //# sourceMappingURL=condition.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"condition.d.ts","sourceRoot":"","sources":["../../../../../src/interface/external/ehr/practicefusion/condition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;EAGjC,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createdConditionSchema = void 0;
4
- const zod_1 = require("zod");
5
- /**
6
- * Schema for FHIR Condition response from PracticeFusion.
7
- * PracticeFusion returns the created FHIR resource with an ID.
8
- */
9
- exports.createdConditionSchema = zod_1.z.object({
10
- resourceType: zod_1.z.literal("Condition"),
11
- id: zod_1.z.string(),
12
- });
13
- //# sourceMappingURL=condition.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"condition.js","sourceRoot":"","sources":["../../../../../src/interface/external/ehr/practicefusion/condition.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB;;;GAGG;AACU,QAAA,sBAAsB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC7C,YAAY,EAAE,OAAC,CAAC,OAAO,CAAC,WAAW,CAAC;IACpC,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE;CACf,CAAC,CAAC"}
@@ -1,8 +0,0 @@
1
- import { AllergyIntolerance } from "@medplum/fhirtypes";
2
- export type AllergyIntoleranceWithPatientRef = Omit<AllergyIntolerance, "patient"> & {
3
- patient: {
4
- type: "Patient";
5
- reference: string;
6
- };
7
- };
8
- //# sourceMappingURL=fhir-resources.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fhir-resources.d.ts","sourceRoot":"","sources":["../../../../../src/interface/external/ehr/practicefusion/fhir-resources.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAExD,MAAM,MAAM,gCAAgC,GAAG,IAAI,CAAC,kBAAkB,EAAE,SAAS,CAAC,GAAG;IACnF,OAAO,EAAE;QACP,IAAI,EAAE,SAAS,CAAC;QAChB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;CACH,CAAC"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=fhir-resources.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fhir-resources.js","sourceRoot":"","sources":["../../../../../src/interface/external/ehr/practicefusion/fhir-resources.ts"],"names":[],"mappings":""}
@@ -1,17 +0,0 @@
1
- import { z } from "zod";
2
- /**
3
- * Schema for FHIR MedicationRequest response from PracticeFusion.
4
- * PracticeFusion returns the created FHIR resource with an ID.
5
- */
6
- export declare const createdMedicationRequestSchema: z.ZodObject<{
7
- resourceType: z.ZodLiteral<"MedicationRequest">;
8
- id: z.ZodString;
9
- }, "strip", z.ZodTypeAny, {
10
- resourceType: "MedicationRequest";
11
- id: string;
12
- }, {
13
- resourceType: "MedicationRequest";
14
- id: string;
15
- }>;
16
- export type CreatedMedicationRequest = z.infer<typeof createdMedicationRequestSchema>;
17
- //# sourceMappingURL=medication.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"medication.d.ts","sourceRoot":"","sources":["../../../../../src/interface/external/ehr/practicefusion/medication.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,eAAO,MAAM,8BAA8B;;;;;;;;;EAGzC,CAAC;AACH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC"}
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createdMedicationRequestSchema = void 0;
4
- const zod_1 = require("zod");
5
- /**
6
- * Schema for FHIR MedicationRequest response from PracticeFusion.
7
- * PracticeFusion returns the created FHIR resource with an ID.
8
- */
9
- exports.createdMedicationRequestSchema = zod_1.z.object({
10
- resourceType: zod_1.z.literal("MedicationRequest"),
11
- id: zod_1.z.string(),
12
- });
13
- //# sourceMappingURL=medication.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"medication.js","sourceRoot":"","sources":["../../../../../src/interface/external/ehr/practicefusion/medication.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB;;;GAGG;AACU,QAAA,8BAA8B,GAAG,OAAC,CAAC,MAAM,CAAC;IACrD,YAAY,EAAE,OAAC,CAAC,OAAO,CAAC,mBAAmB,CAAC;IAC5C,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE;CACf,CAAC,CAAC"}
@@ -1,47 +0,0 @@
1
- import { z } from "zod";
2
- /**
3
- * Schema for FHIR Condition response from PracticeFusion.
4
- * PracticeFusion returns the created FHIR resource with an ID.
5
- */
6
- export declare const createdConditionSchema: z.ZodObject<{
7
- resourceType: z.ZodLiteral<"Condition">;
8
- id: z.ZodString;
9
- }, "strip", z.ZodTypeAny, {
10
- resourceType: "Condition";
11
- id: string;
12
- }, {
13
- resourceType: "Condition";
14
- id: string;
15
- }>;
16
- export type CreatedCondition = z.infer<typeof createdConditionSchema>;
17
- /**
18
- * Schema for FHIR AllergyIntolerance response from PracticeFusion.
19
- * PracticeFusion returns the created FHIR resource with an ID.
20
- */
21
- export declare const createdAllergyIntoleranceSchema: z.ZodObject<{
22
- resourceType: z.ZodLiteral<"AllergyIntolerance">;
23
- id: z.ZodString;
24
- }, "strip", z.ZodTypeAny, {
25
- resourceType: "AllergyIntolerance";
26
- id: string;
27
- }, {
28
- resourceType: "AllergyIntolerance";
29
- id: string;
30
- }>;
31
- export type CreatedAllergyIntolerance = z.infer<typeof createdAllergyIntoleranceSchema>;
32
- /**
33
- * Schema for FHIR MedicationRequest response from PracticeFusion.
34
- * PracticeFusion returns the created FHIR resource with an ID.
35
- */
36
- export declare const createdMedicationRequestSchema: z.ZodObject<{
37
- resourceType: z.ZodLiteral<"MedicationRequest">;
38
- id: z.ZodString;
39
- }, "strip", z.ZodTypeAny, {
40
- resourceType: "MedicationRequest";
41
- id: string;
42
- }, {
43
- resourceType: "MedicationRequest";
44
- id: string;
45
- }>;
46
- export type CreatedMedicationRequest = z.infer<typeof createdMedicationRequestSchema>;
47
- //# sourceMappingURL=write-back.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"write-back.d.ts","sourceRoot":"","sources":["../../../../../src/interface/external/ehr/practicefusion/write-back.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;EAGjC,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE;;;GAGG;AACH,eAAO,MAAM,+BAA+B;;;;;;;;;EAG1C,CAAC;AACH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAExF;;;GAGG;AACH,eAAO,MAAM,8BAA8B;;;;;;;;;EAGzC,CAAC;AACH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC"}
@@ -1,29 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createdMedicationRequestSchema = exports.createdAllergyIntoleranceSchema = exports.createdConditionSchema = void 0;
4
- const zod_1 = require("zod");
5
- /**
6
- * Schema for FHIR Condition response from PracticeFusion.
7
- * PracticeFusion returns the created FHIR resource with an ID.
8
- */
9
- exports.createdConditionSchema = zod_1.z.object({
10
- resourceType: zod_1.z.literal("Condition"),
11
- id: zod_1.z.string(),
12
- });
13
- /**
14
- * Schema for FHIR AllergyIntolerance response from PracticeFusion.
15
- * PracticeFusion returns the created FHIR resource with an ID.
16
- */
17
- exports.createdAllergyIntoleranceSchema = zod_1.z.object({
18
- resourceType: zod_1.z.literal("AllergyIntolerance"),
19
- id: zod_1.z.string(),
20
- });
21
- /**
22
- * Schema for FHIR MedicationRequest response from PracticeFusion.
23
- * PracticeFusion returns the created FHIR resource with an ID.
24
- */
25
- exports.createdMedicationRequestSchema = zod_1.z.object({
26
- resourceType: zod_1.z.literal("MedicationRequest"),
27
- id: zod_1.z.string(),
28
- });
29
- //# sourceMappingURL=write-back.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"write-back.js","sourceRoot":"","sources":["../../../../../src/interface/external/ehr/practicefusion/write-back.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB;;;GAGG;AACU,QAAA,sBAAsB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC7C,YAAY,EAAE,OAAC,CAAC,OAAO,CAAC,WAAW,CAAC;IACpC,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE;CACf,CAAC,CAAC;AAGH;;;GAGG;AACU,QAAA,+BAA+B,GAAG,OAAC,CAAC,MAAM,CAAC;IACtD,YAAY,EAAE,OAAC,CAAC,OAAO,CAAC,oBAAoB,CAAC;IAC7C,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE;CACf,CAAC,CAAC;AAGH;;;GAGG;AACU,QAAA,8BAA8B,GAAG,OAAC,CAAC,MAAM,CAAC;IACrD,YAAY,EAAE,OAAC,CAAC,OAAO,CAAC,mBAAmB,CAAC;IAC5C,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE;CACf,CAAC,CAAC"}