@pulsecharterconnect/types 0.2.33 → 0.2.35
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/dist/types/Proposal.js
CHANGED
|
@@ -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) ||
|
|
@@ -400,7 +396,6 @@ class TransportationRequest {
|
|
|
400
396
|
{
|
|
401
397
|
transportationOperatorId: this.organizationId,
|
|
402
398
|
groundTransportationServices: [],
|
|
403
|
-
typeOfService: Proposal_1.TypeOfService.GROUND,
|
|
404
399
|
passengers: [],
|
|
405
400
|
segmentStatus: Trip_1.SegmentStatus.NOT_STARTED,
|
|
406
401
|
segmentType: Trip_1.SegmentType.GROUND_TRANSPORTATION,
|
|
@@ -424,7 +419,6 @@ class TransportationRequest {
|
|
|
424
419
|
passengers: [],
|
|
425
420
|
segmentStatus: Trip_1.SegmentStatus.NOT_STARTED,
|
|
426
421
|
segmentType: Trip_1.SegmentType.GROUND_TRANSPORTATION,
|
|
427
|
-
typeOfService: Proposal_1.TypeOfService.GROUND,
|
|
428
422
|
segmentNumber: 0,
|
|
429
423
|
scheduledArrivalLocation: this.recoveryLocation,
|
|
430
424
|
scheduledDepartureLocation: distalAirportLocation,
|
|
@@ -443,7 +437,6 @@ class TransportationRequest {
|
|
|
443
437
|
passengers: [],
|
|
444
438
|
segmentStatus: Trip_1.SegmentStatus.NOT_STARTED,
|
|
445
439
|
segmentType: Trip_1.SegmentType.GROUND_TRANSPORTATION,
|
|
446
|
-
typeOfService: Proposal_1.TypeOfService.GROUND,
|
|
447
440
|
segmentNumber: 0,
|
|
448
441
|
scheduledDepartureLocation: this.recoveryLocation,
|
|
449
442
|
scheduledArrivalLocation: distalAirportLocation,
|
|
@@ -464,7 +457,6 @@ class TransportationRequest {
|
|
|
464
457
|
passengers: [],
|
|
465
458
|
segmentStatus: Trip_1.SegmentStatus.NOT_STARTED,
|
|
466
459
|
segmentType: Trip_1.SegmentType.GROUND_TRANSPORTATION,
|
|
467
|
-
typeOfService: Proposal_1.TypeOfService.GROUND,
|
|
468
460
|
segmentNumber: 0,
|
|
469
461
|
scheduledArrivalLocation: this.recipientFacility,
|
|
470
462
|
scheduledDepartureLocation: localAirportLocation,
|
|
@@ -491,7 +483,6 @@ class TransportationRequest {
|
|
|
491
483
|
passengers: [],
|
|
492
484
|
segmentStatus: Trip_1.SegmentStatus.NOT_STARTED,
|
|
493
485
|
segmentType: Trip_1.SegmentType.GROUND_TRANSPORTATION,
|
|
494
|
-
typeOfService: Proposal_1.TypeOfService.GROUND,
|
|
495
486
|
segmentNumber: 0,
|
|
496
487
|
scheduledArrivalLocation: distalAirportLocation,
|
|
497
488
|
scheduledDepartureLocation: this.pickupLocation || this.recoveryLocation,
|
|
@@ -512,7 +503,6 @@ class TransportationRequest {
|
|
|
512
503
|
passengers: [],
|
|
513
504
|
segmentStatus: Trip_1.SegmentStatus.NOT_STARTED,
|
|
514
505
|
segmentType: Trip_1.SegmentType.GROUND_TRANSPORTATION,
|
|
515
|
-
typeOfService: Proposal_1.TypeOfService.GROUND,
|
|
516
506
|
segmentNumber: 0,
|
|
517
507
|
scheduledArrivalLocation: this.recipientFacility,
|
|
518
508
|
scheduledDepartureLocation: localAirportLocation,
|
|
@@ -532,6 +522,32 @@ class TransportationRequest {
|
|
|
532
522
|
];
|
|
533
523
|
}
|
|
534
524
|
}
|
|
525
|
+
createTripOrganRecoverySegmentFromTransportationRequest() {
|
|
526
|
+
const tripOrganRecoverySegment = {
|
|
527
|
+
segmentNumber: 0,
|
|
528
|
+
segmentStatus: Trip_1.SegmentStatus.NOT_STARTED,
|
|
529
|
+
segmentType: Trip_1.SegmentType.ORGAN_RECOVERY,
|
|
530
|
+
scheduledArrivalTime: luxon_1.DateTime.fromMillis(this.orDateTimeGMT)
|
|
531
|
+
.minus({ minutes: 30 })
|
|
532
|
+
.toMillis(),
|
|
533
|
+
organRecoveryInProcessStatus: Trip_1.OrganRecoveryInProcessStatus.NOT_STARTED,
|
|
534
|
+
organRecoveryLocation: this.recoveryLocation,
|
|
535
|
+
scheduledORTime: this.orDateTimeGMT,
|
|
536
|
+
scheduledORTimeTimezone: this.orTimezone,
|
|
537
|
+
estimatedOrganRecoveryTime: luxon_1.DateTime.fromMillis(this.orDateTimeGMT)
|
|
538
|
+
.plus(exports.RECOVERY_TIME_DURATION[this.recoveryType] || "3 hours")
|
|
539
|
+
.toMillis(),
|
|
540
|
+
estimatedOrganRecoveryTimeTimezone: this.orTimezone,
|
|
541
|
+
surgicalTeam: [],
|
|
542
|
+
scheduledArrivalTimeTimezone: this.orTimezone,
|
|
543
|
+
scheduledDepartureTime: luxon_1.DateTime.fromMillis(this.orDateTimeGMT)
|
|
544
|
+
.plus(exports.RECOVERY_TIME_DURATION[this.recoveryType] || "3 hours")
|
|
545
|
+
.plus({ minutes: 30 })
|
|
546
|
+
.toMillis(),
|
|
547
|
+
scheduledDepartureTimeTimezone: this.orTimezone,
|
|
548
|
+
};
|
|
549
|
+
return tripOrganRecoverySegment;
|
|
550
|
+
}
|
|
535
551
|
}
|
|
536
552
|
exports.TransportationRequest = TransportationRequest;
|
|
537
553
|
function calculateTravelTime(distanceMiles, speedMph) {
|
package/dist/types/Trip.d.ts
CHANGED
|
@@ -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
|
|
180
|
-
actualORTimeTimezone
|
|
180
|
+
actualORTime?: number;
|
|
181
|
+
actualORTimeTimezone?: string;
|
|
181
182
|
estimatedOrganRecoveryTime: number;
|
|
182
183
|
estimatedOrganRecoveryTimeTimezone: string;
|
|
183
|
-
actualOrganRecoveryTime
|
|
184
|
-
actualOrganRecoveryTimeTimezone
|
|
184
|
+
actualOrganRecoveryTime?: number;
|
|
185
|
+
actualOrganRecoveryTimeTimezone?: string;
|
|
185
186
|
surgicalTeam: ITripParticipant[];
|
|
186
187
|
}
|
|
187
188
|
export interface ITrip {
|
|
@@ -238,5 +239,5 @@ export declare class Trip implements ITrip {
|
|
|
238
239
|
createdAt?: number;
|
|
239
240
|
updatedAt?: number;
|
|
240
241
|
constructor(trip: ITrip);
|
|
241
|
-
sortTripSegments(): Array<ITripSegment>;
|
|
242
242
|
}
|
|
243
|
+
export declare function sortTripSegments(tripSegments: Array<ITripSegment>): Array<ITripSegment>;
|
package/dist/types/Trip.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Trip = exports.Participant = exports.Gender = exports.TripParticipantRole = exports.TripActions = exports.SegmentType = exports.OrganRecoveryInProcessStatus = exports.SegmentStatus = exports.getOrganRecoveryInProcessStatusLabel = exports.getSegmentStatusLabel = exports.getTripStatusLabel = exports.TripStatus = void 0;
|
|
3
|
+
exports.sortTripSegments = exports.Trip = exports.Participant = exports.Gender = exports.TripParticipantRole = exports.TripActions = exports.SegmentType = exports.OrganRecoveryInProcessStatus = exports.SegmentStatus = exports.getOrganRecoveryInProcessStatusLabel = exports.getSegmentStatusLabel = exports.getTripStatusLabel = exports.TripStatus = void 0;
|
|
4
4
|
var TripStatus;
|
|
5
5
|
(function (TripStatus) {
|
|
6
6
|
TripStatus["PREPARATION"] = "preparation";
|
|
@@ -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) {
|
|
@@ -166,16 +167,13 @@ class Trip {
|
|
|
166
167
|
this.createdAt = trip.createdAt;
|
|
167
168
|
this.updatedAt = trip.updatedAt;
|
|
168
169
|
}
|
|
169
|
-
sortTripSegments() {
|
|
170
|
-
var _a;
|
|
171
|
-
if (!this.tripSegments)
|
|
172
|
-
return [];
|
|
173
|
-
const tripSegments = (_a = this.tripSegments) === null || _a === void 0 ? void 0 : _a.sort((a, b) => a.scheduledDepartureTime - b.scheduledDepartureTime);
|
|
174
|
-
for (const [idx, tripSegment] of tripSegments === null || tripSegments === void 0 ? void 0 : tripSegments.entries()) {
|
|
175
|
-
tripSegment.segmentNumber = idx + 1;
|
|
176
|
-
}
|
|
177
|
-
this.tripSegments = tripSegments;
|
|
178
|
-
return tripSegments;
|
|
179
|
-
}
|
|
180
170
|
}
|
|
181
171
|
exports.Trip = Trip;
|
|
172
|
+
function sortTripSegments(tripSegments) {
|
|
173
|
+
tripSegments = tripSegments.sort((a, b) => a.scheduledDepartureTime - b.scheduledDepartureTime);
|
|
174
|
+
for (const [idx, tripSegment] of tripSegments.entries()) {
|
|
175
|
+
tripSegment.segmentNumber = idx + 1;
|
|
176
|
+
}
|
|
177
|
+
return tripSegments;
|
|
178
|
+
}
|
|
179
|
+
exports.sortTripSegments = sortTripSegments;
|