@pulsecharterconnect/types 0.2.34 → 0.2.36

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.
@@ -59,7 +59,6 @@ class Proposal {
59
59
  scheduledDepartureTimeTimezone: proposalSegment.scheduledDepartureTimezone || "",
60
60
  scheduledArrivalTime: proposalSegment.scheduledArrivalTime,
61
61
  scheduledArrivalTimeTimezone: proposalSegment.scheduledArrivalTimezone || "",
62
- typeOfService: TypeOfService.AIR,
63
62
  transportationOperatorId: this.transportationOperatorId,
64
63
  scheduledDepartureAirportCode: proposalSegment.scheduledDepartureAirportCode,
65
64
  scheduledDepartureAirportLocation: proposalSegment.scheduledDepartureAirportLocation,
@@ -88,7 +87,6 @@ class Proposal {
88
87
  scheduledDepartureTimeTimezone: proposalSegment.scheduledDepartureTimezone || "",
89
88
  scheduledArrivalTime: proposalSegment.scheduledArrivalTime,
90
89
  scheduledArrivalTimeTimezone: proposalSegment.scheduledArrivalTimezone || "",
91
- typeOfService: TypeOfService.GROUND,
92
90
  transportationOperatorId: this.transportationOperatorId,
93
91
  scheduledDepartureLocation: proposalSegment.scheduledDepartureLocation,
94
92
  scheduledArrivalLocation: proposalSegment.scheduledArrivalLocation,
@@ -180,6 +180,7 @@ export declare class TransportationRequest implements ITransportationRequest {
180
180
  airTransportationRecommended(): boolean;
181
181
  createTripAirSegmentsFromTransportationRequest(localTimezone: string, distalTimezone: string): ITripSegment[];
182
182
  createTripGroundSegmentsFromTransportationRequest(localTimezone: string, distalTimezone: string): ITripSegment[];
183
+ createTripOrganRecoverySegmentFromTransportationRequest(): ITripSegment;
183
184
  }
184
185
  export declare function calculateTravelTime(distanceMiles: number, speedMph: number): Duration;
185
186
  /**
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getProcedureTime = exports.calculateTravelTime = exports.TransportationRequest = exports.RECOVERY_TIME_DURATION = exports.RECOVERY_TIME = exports.RecoveryType = exports.SegmentLocationType = exports.getEquipmentForOrgan = exports.EquipmentType = exports.KidneyEquipmentType = exports.LiverEquipmentType = exports.LungEquipmentType = exports.HeartEquipmentType = exports.OrganType = exports.TransportRequestType = exports.OrganRecoveryStatus = exports.TransportationRequestProposalStatus = exports.TransportationRequestStatus = exports.AVERAGE_AIR_SPEED = exports.DISTANCE_THRESHOLD_MILES_AIR_VS_GROUND = void 0;
4
4
  const luxon_1 = require("luxon");
5
5
  const Trip_1 = require("./Trip");
6
- const Proposal_1 = require("./Proposal");
7
6
  exports.DISTANCE_THRESHOLD_MILES_AIR_VS_GROUND = 100;
8
7
  exports.AVERAGE_AIR_SPEED = 450;
9
8
  var TransportationRequestStatus;
@@ -229,7 +228,6 @@ class TransportationRequest {
229
228
  segmentType: Trip_1.SegmentType.AIR_TRANSPORTATION,
230
229
  segmentStatus: Trip_1.SegmentStatus.NOT_STARTED,
231
230
  passengers: [],
232
- typeOfService: Proposal_1.TypeOfService.AIR,
233
231
  segmentNumber: 0,
234
232
  scheduledDepartureAirportCode: `${(_b = this.recipientFacility) === null || _b === void 0 ? void 0 : _b.city} area airport`,
235
233
  scheduledArrivalAirportCode: `${(_c = this.recoveryLocation) === null || _c === void 0 ? void 0 : _c.city} area airport`,
@@ -257,7 +255,6 @@ class TransportationRequest {
257
255
  passengers: [],
258
256
  segmentStatus: Trip_1.SegmentStatus.NOT_STARTED,
259
257
  segmentType: Trip_1.SegmentType.AIR_TRANSPORTATION,
260
- typeOfService: Proposal_1.TypeOfService.AIR,
261
258
  segmentNumber: 0,
262
259
  scheduledDepartureAirportCode: `${(_d = this.recoveryLocation) === null || _d === void 0 ? void 0 : _d.city} area airport`,
263
260
  scheduledDepartureAirportLocation: this.recoveryLocation.location || {
@@ -290,7 +287,6 @@ class TransportationRequest {
290
287
  passengers: [],
291
288
  segmentStatus: Trip_1.SegmentStatus.NOT_STARTED,
292
289
  segmentType: Trip_1.SegmentType.AIR_TRANSPORTATION,
293
- typeOfService: Proposal_1.TypeOfService.AIR,
294
290
  segmentNumber: 0,
295
291
  scheduledDepartureAirportCode: `${((_f = this.pickupLocation) === null || _f === void 0 ? void 0 : _f.city) || ((_g = this.recoveryLocation) === null || _g === void 0 ? void 0 : _g.city)} area airport`,
296
292
  scheduledDepartureAirportLocation: ((_h = this.pickupLocation) === null || _h === void 0 ? void 0 : _h.location) ||
@@ -317,7 +313,7 @@ class TransportationRequest {
317
313
  }
318
314
  }
319
315
  createTripGroundSegmentsFromTransportationRequest(localTimezone, distalTimezone) {
320
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4;
316
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5;
321
317
  const recoveryTimeInMinutes = (_a = exports.RECOVERY_TIME_DURATION[this.recoveryType]) !== null && _a !== void 0 ? _a : luxon_1.Duration.fromObject({ hours: 3, minutes: 0 });
322
318
  const localAirportLocation = {
323
319
  id: "1234",
@@ -329,36 +325,37 @@ class TransportationRequest {
329
325
  zip: ((_f = this.recipientFacility) === null || _f === void 0 ? void 0 : _f.zip) || "",
330
326
  location: (_g = this.recipientFacility) === null || _g === void 0 ? void 0 : _g.location,
331
327
  utcOffsetMinutes: (_h = this.recipientFacility) === null || _h === void 0 ? void 0 : _h.utcOffsetMinutes,
328
+ timezone: (_j = this.recipientFacility) === null || _j === void 0 ? void 0 : _j.timezone,
332
329
  };
333
330
  const distalAirportLocation = this.transportationRequestType === TransportRequestType.ROUND_TRIP
334
331
  ? {
335
332
  id: "5678",
336
- displayName: `${(_j = this.recoveryLocation) === null || _j === void 0 ? void 0 : _j.city} area airport`,
333
+ displayName: `${(_k = this.recoveryLocation) === null || _k === void 0 ? void 0 : _k.city} area airport`,
337
334
  formattedAddress: "",
338
- city: ((_k = this.recoveryLocation) === null || _k === void 0 ? void 0 : _k.city) || "",
339
- county: (_l = this.recoveryLocation) === null || _l === void 0 ? void 0 : _l.county,
340
- state: ((_m = this.recoveryLocation) === null || _m === void 0 ? void 0 : _m.state) || "",
341
- zip: ((_o = this.recoveryLocation) === null || _o === void 0 ? void 0 : _o.zip) || "",
342
- location: (_p = this.recoveryLocation) === null || _p === void 0 ? void 0 : _p.location,
343
- utcOffsetMinutes: (_q = this.recoveryLocation) === null || _q === void 0 ? void 0 : _q.utcOffsetMinutes,
335
+ city: ((_l = this.recoveryLocation) === null || _l === void 0 ? void 0 : _l.city) || "",
336
+ county: (_m = this.recoveryLocation) === null || _m === void 0 ? void 0 : _m.county,
337
+ state: ((_o = this.recoveryLocation) === null || _o === void 0 ? void 0 : _o.state) || "",
338
+ zip: ((_p = this.recoveryLocation) === null || _p === void 0 ? void 0 : _p.zip) || "",
339
+ location: (_q = this.recoveryLocation) === null || _q === void 0 ? void 0 : _q.location,
340
+ utcOffsetMinutes: (_r = this.recoveryLocation) === null || _r === void 0 ? void 0 : _r.utcOffsetMinutes,
344
341
  }
345
342
  : {
346
343
  id: "5678",
347
- displayName: `${((_r = this.pickupLocation) === null || _r === void 0 ? void 0 : _r.city) || ((_s = this.recoveryLocation) === null || _s === void 0 ? void 0 : _s.city)} area airport`,
344
+ displayName: `${((_s = this.pickupLocation) === null || _s === void 0 ? void 0 : _s.city) || ((_t = this.recoveryLocation) === null || _t === void 0 ? void 0 : _t.city)} area airport`,
348
345
  formattedAddress: "",
349
- city: ((_t = this.pickupLocation) === null || _t === void 0 ? void 0 : _t.city) || ((_u = this.recoveryLocation) === null || _u === void 0 ? void 0 : _u.city) || "",
350
- county: ((_v = this.pickupLocation) === null || _v === void 0 ? void 0 : _v.county) ||
351
- ((_w = this.recoveryLocation) === null || _w === void 0 ? void 0 : _w.county) ||
346
+ city: ((_u = this.pickupLocation) === null || _u === void 0 ? void 0 : _u.city) || ((_v = this.recoveryLocation) === null || _v === void 0 ? void 0 : _v.city) || "",
347
+ county: ((_w = this.pickupLocation) === null || _w === void 0 ? void 0 : _w.county) ||
348
+ ((_x = this.recoveryLocation) === null || _x === void 0 ? void 0 : _x.county) ||
352
349
  "",
353
- state: ((_x = this.pickupLocation) === null || _x === void 0 ? void 0 : _x.state) || ((_y = this.recoveryLocation) === null || _y === void 0 ? void 0 : _y.state) || "",
354
- zip: ((_z = this.pickupLocation) === null || _z === void 0 ? void 0 : _z.zip) || ((_0 = this.recoveryLocation) === null || _0 === void 0 ? void 0 : _0.zip) || "",
355
- location: ((_1 = this.pickupLocation) === null || _1 === void 0 ? void 0 : _1.location) ||
356
- ((_2 = this.recoveryLocation) === null || _2 === void 0 ? void 0 : _2.location) || {
350
+ state: ((_y = this.pickupLocation) === null || _y === void 0 ? void 0 : _y.state) || ((_z = this.recoveryLocation) === null || _z === void 0 ? void 0 : _z.state) || "",
351
+ zip: ((_0 = this.pickupLocation) === null || _0 === void 0 ? void 0 : _0.zip) || ((_1 = this.recoveryLocation) === null || _1 === void 0 ? void 0 : _1.zip) || "",
352
+ location: ((_2 = this.pickupLocation) === null || _2 === void 0 ? void 0 : _2.location) ||
353
+ ((_3 = this.recoveryLocation) === null || _3 === void 0 ? void 0 : _3.location) || {
357
354
  lat: 0,
358
355
  lng: 0,
359
356
  },
360
- utcOffsetMinutes: ((_3 = this.pickupLocation) === null || _3 === void 0 ? void 0 : _3.utcOffsetMinutes) ||
361
- ((_4 = this.recoveryLocation) === null || _4 === void 0 ? void 0 : _4.utcOffsetMinutes),
357
+ utcOffsetMinutes: ((_4 = this.pickupLocation) === null || _4 === void 0 ? void 0 : _4.utcOffsetMinutes) ||
358
+ ((_5 = this.recoveryLocation) === null || _5 === void 0 ? void 0 : _5.utcOffsetMinutes),
362
359
  };
363
360
  const tripDistanceInMiles = this.tripDistanceInMiles || 0;
364
361
  const flightTime = calculateTravelTime(tripDistanceInMiles, exports.AVERAGE_AIR_SPEED);
@@ -400,12 +397,12 @@ class TransportationRequest {
400
397
  {
401
398
  transportationOperatorId: this.organizationId,
402
399
  groundTransportationServices: [],
403
- typeOfService: Proposal_1.TypeOfService.GROUND,
404
400
  passengers: [],
405
401
  segmentStatus: Trip_1.SegmentStatus.NOT_STARTED,
406
402
  segmentType: Trip_1.SegmentType.GROUND_TRANSPORTATION,
407
403
  segmentNumber: 0,
408
404
  scheduledArrivalLocation: localAirportLocation,
405
+ scheduledArrivalTimeTimezone: localTimezone,
409
406
  scheduledDepartureLocation: this.recipientFacility,
410
407
  scheduledDepartureTime: luxon_1.DateTime.fromMillis(this.orDateTimeGMT)
411
408
  .minus(flightTime)
@@ -416,7 +413,6 @@ class TransportationRequest {
416
413
  .minus(flightTime)
417
414
  .minus({ hours: 2, minutes: 0 })
418
415
  .toMillis(),
419
- scheduledArrivalTimeTimezone: localTimezone,
420
416
  },
421
417
  {
422
418
  transportationOperatorId: this.organizationId,
@@ -424,7 +420,6 @@ class TransportationRequest {
424
420
  passengers: [],
425
421
  segmentStatus: Trip_1.SegmentStatus.NOT_STARTED,
426
422
  segmentType: Trip_1.SegmentType.GROUND_TRANSPORTATION,
427
- typeOfService: Proposal_1.TypeOfService.GROUND,
428
423
  segmentNumber: 0,
429
424
  scheduledArrivalLocation: this.recoveryLocation,
430
425
  scheduledDepartureLocation: distalAirportLocation,
@@ -443,7 +438,6 @@ class TransportationRequest {
443
438
  passengers: [],
444
439
  segmentStatus: Trip_1.SegmentStatus.NOT_STARTED,
445
440
  segmentType: Trip_1.SegmentType.GROUND_TRANSPORTATION,
446
- typeOfService: Proposal_1.TypeOfService.GROUND,
447
441
  segmentNumber: 0,
448
442
  scheduledDepartureLocation: this.recoveryLocation,
449
443
  scheduledArrivalLocation: distalAirportLocation,
@@ -464,7 +458,6 @@ class TransportationRequest {
464
458
  passengers: [],
465
459
  segmentStatus: Trip_1.SegmentStatus.NOT_STARTED,
466
460
  segmentType: Trip_1.SegmentType.GROUND_TRANSPORTATION,
467
- typeOfService: Proposal_1.TypeOfService.GROUND,
468
461
  segmentNumber: 0,
469
462
  scheduledArrivalLocation: this.recipientFacility,
470
463
  scheduledDepartureLocation: localAirportLocation,
@@ -491,7 +484,6 @@ class TransportationRequest {
491
484
  passengers: [],
492
485
  segmentStatus: Trip_1.SegmentStatus.NOT_STARTED,
493
486
  segmentType: Trip_1.SegmentType.GROUND_TRANSPORTATION,
494
- typeOfService: Proposal_1.TypeOfService.GROUND,
495
487
  segmentNumber: 0,
496
488
  scheduledArrivalLocation: distalAirportLocation,
497
489
  scheduledDepartureLocation: this.pickupLocation || this.recoveryLocation,
@@ -512,7 +504,6 @@ class TransportationRequest {
512
504
  passengers: [],
513
505
  segmentStatus: Trip_1.SegmentStatus.NOT_STARTED,
514
506
  segmentType: Trip_1.SegmentType.GROUND_TRANSPORTATION,
515
- typeOfService: Proposal_1.TypeOfService.GROUND,
516
507
  segmentNumber: 0,
517
508
  scheduledArrivalLocation: this.recipientFacility,
518
509
  scheduledDepartureLocation: localAirportLocation,
@@ -532,6 +523,32 @@ class TransportationRequest {
532
523
  ];
533
524
  }
534
525
  }
526
+ createTripOrganRecoverySegmentFromTransportationRequest() {
527
+ const tripOrganRecoverySegment = {
528
+ segmentNumber: 0,
529
+ segmentStatus: Trip_1.SegmentStatus.NOT_STARTED,
530
+ segmentType: Trip_1.SegmentType.ORGAN_RECOVERY,
531
+ scheduledArrivalTime: luxon_1.DateTime.fromMillis(this.orDateTimeGMT)
532
+ .minus({ minutes: 30 })
533
+ .toMillis(),
534
+ organRecoveryInProcessStatus: Trip_1.OrganRecoveryInProcessStatus.NOT_STARTED,
535
+ organRecoveryLocation: this.recoveryLocation,
536
+ scheduledORTime: this.orDateTimeGMT,
537
+ scheduledORTimeTimezone: this.orTimezone,
538
+ estimatedOrganRecoveryTime: luxon_1.DateTime.fromMillis(this.orDateTimeGMT)
539
+ .plus(exports.RECOVERY_TIME_DURATION[this.recoveryType] || "3 hours")
540
+ .toMillis(),
541
+ estimatedOrganRecoveryTimeTimezone: this.orTimezone,
542
+ surgicalTeam: [],
543
+ scheduledArrivalTimeTimezone: this.orTimezone,
544
+ scheduledDepartureTime: luxon_1.DateTime.fromMillis(this.orDateTimeGMT)
545
+ .plus(exports.RECOVERY_TIME_DURATION[this.recoveryType] || "3 hours")
546
+ .plus({ minutes: 30 })
547
+ .toMillis(),
548
+ scheduledDepartureTimeTimezone: this.orTimezone,
549
+ };
550
+ return tripOrganRecoverySegment;
551
+ }
535
552
  }
536
553
  exports.TransportationRequest = TransportationRequest;
537
554
  function calculateTravelTime(distanceMiles, speedMph) {
@@ -24,7 +24,8 @@ export declare enum OrganRecoveryInProcessStatus {
24
24
  INCISION_MADE = "incision-made",
25
25
  HEPARIN_ADMINISTERED = "heparin-administered",
26
26
  CROSS_CLAMP = "cross-clamp",
27
- ORGAN_RECOVERED = "organ-recovered"
27
+ ORGAN_RECOVERED = "organ-recovered",
28
+ NOT_STARTED = "not-started"
28
29
  }
29
30
  export declare enum SegmentType {
30
31
  AIR_TRANSPORTATION = "air-transportation",
@@ -43,7 +44,7 @@ export declare enum TripActions {
43
44
  HEPARIN_ADMINISTERED = "heparinAdministered",
44
45
  ORGAN_REMOVED = "organRemoved"
45
46
  }
46
- export interface ITripSegment extends IProposalSegment {
47
+ export interface ITripSegment extends Omit<IProposalSegment, "typeOfService"> {
47
48
  segmentType: SegmentType;
48
49
  scheduledDepartureTime: number;
49
50
  scheduledDepartureTimeTimezone: string;
@@ -176,12 +177,12 @@ export interface ITripOrganRecoverySegment extends ITripSegment {
176
177
  organRecoveryLocation: Facility;
177
178
  scheduledORTime: number;
178
179
  scheduledORTimeTimezone: string;
179
- actualORTime: number;
180
- actualORTimeTimezone: string;
180
+ actualORTime?: number;
181
+ actualORTimeTimezone?: string;
181
182
  estimatedOrganRecoveryTime: number;
182
183
  estimatedOrganRecoveryTimeTimezone: string;
183
- actualOrganRecoveryTime: number;
184
- actualOrganRecoveryTimeTimezone: string;
184
+ actualOrganRecoveryTime?: number;
185
+ actualOrganRecoveryTimeTimezone?: string;
185
186
  surgicalTeam: ITripParticipant[];
186
187
  }
187
188
  export interface ITrip {
@@ -75,6 +75,7 @@ var OrganRecoveryInProcessStatus;
75
75
  OrganRecoveryInProcessStatus["HEPARIN_ADMINISTERED"] = "heparin-administered";
76
76
  OrganRecoveryInProcessStatus["CROSS_CLAMP"] = "cross-clamp";
77
77
  OrganRecoveryInProcessStatus["ORGAN_RECOVERED"] = "organ-recovered";
78
+ OrganRecoveryInProcessStatus["NOT_STARTED"] = "not-started";
78
79
  })(OrganRecoveryInProcessStatus = exports.OrganRecoveryInProcessStatus || (exports.OrganRecoveryInProcessStatus = {}));
79
80
  var SegmentType;
80
81
  (function (SegmentType) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pulsecharterconnect/types",
3
- "version": "0.2.34",
3
+ "version": "0.2.36",
4
4
  "description": "A TypeScript library for enhanced type safety.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",