@opengovsg/refx-ts-sdk 0.0.0-develop-1759151439 → 0.0.0-develop-alpha-1762412839

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 (121) hide show
  1. package/README.md +18 -0
  2. package/api/resources/eligibility/client/Client.d.ts +3 -0
  3. package/api/resources/eligibility/client/Client.js +7 -10
  4. package/api/resources/eligibility/client/requests/EligibilityGetRequest.d.ts +8 -5
  5. package/api/resources/health/client/Client.js +1 -1
  6. package/api/resources/index.d.ts +2 -1
  7. package/api/resources/index.js +3 -2
  8. package/api/resources/links/client/Client.js +1 -1
  9. package/api/resources/links/client/requests/CreateLinkReqUpsert.d.ts +8 -0
  10. package/api/resources/links/types/CreateLinkReqUpsertClinicType.d.ts +11 -0
  11. package/api/resources/links/types/CreateLinkReqUpsertClinicType.js +10 -0
  12. package/api/resources/links/types/index.d.ts +1 -0
  13. package/api/resources/links/types/index.js +1 -0
  14. package/api/resources/notes/client/Client.js +1 -1
  15. package/api/resources/offerings/client/Client.d.ts +6 -2
  16. package/api/resources/offerings/client/Client.js +13 -15
  17. package/api/resources/offerings/client/requests/OfferingsListRequest.d.ts +10 -6
  18. package/api/resources/public/client/Client.js +1 -1
  19. package/api/resources/referrals/client/Client.js +9 -9
  20. package/api/resources/referrals/client/requests/CreateReferralReq.d.ts +6 -0
  21. package/api/resources/referrals/index.d.ts +1 -0
  22. package/api/resources/referrals/index.js +1 -0
  23. package/api/resources/referrals/types/CreateReferralReqClinicType.d.ts +11 -0
  24. package/api/resources/referrals/types/CreateReferralReqClinicType.js +10 -0
  25. package/api/resources/referrals/types/index.d.ts +1 -0
  26. package/api/resources/referrals/types/index.js +17 -0
  27. package/api/resources/webhooks/client/Client.js +2 -2
  28. package/api/types/AdditionalReferralField.d.ts +2 -1
  29. package/api/types/AdditionalReferralField.js +1 -0
  30. package/api/types/AppointmentDto.d.ts +12 -0
  31. package/api/types/AppointmentDto.js +5 -0
  32. package/api/types/AppointmentDtoStatus.d.ts +11 -0
  33. package/api/types/AppointmentDtoStatus.js +13 -0
  34. package/api/types/CreatePatientReq.d.ts +2 -0
  35. package/api/types/FullReferralDto.d.ts +7 -0
  36. package/api/types/FullReferralDtoClinicType.d.ts +11 -0
  37. package/api/types/FullReferralDtoClinicType.js +10 -0
  38. package/api/types/GetReferralPatientDto.d.ts +2 -0
  39. package/api/types/PublicReferralDto.d.ts +6 -0
  40. package/api/types/PublicReferralDtoClinicType.d.ts +11 -0
  41. package/api/types/PublicReferralDtoClinicType.js +10 -0
  42. package/api/types/ReferralDto.d.ts +6 -0
  43. package/api/types/ReferralDtoClinicType.d.ts +11 -0
  44. package/api/types/ReferralDtoClinicType.js +10 -0
  45. package/api/types/ReferralLinkType.d.ts +2 -1
  46. package/api/types/ReferralLinkType.js +1 -0
  47. package/api/types/ReferrerIdType.d.ts +2 -1
  48. package/api/types/ReferrerIdType.js +1 -0
  49. package/api/types/UpdateEmailAckOfferingReq.d.ts +9 -0
  50. package/api/types/UpdateEmailAckOfferingReq.js +5 -0
  51. package/api/types/index.d.ts +6 -0
  52. package/api/types/index.js +6 -0
  53. package/browser/jsonwebtoken-stub.d.ts +5 -0
  54. package/browser/jsonwebtoken-stub.js +10 -0
  55. package/dist/api/resources/eligibility/client/Client.d.ts +3 -0
  56. package/dist/api/resources/eligibility/client/Client.js +7 -10
  57. package/dist/api/resources/eligibility/client/requests/EligibilityGetRequest.d.ts +8 -5
  58. package/dist/api/resources/health/client/Client.js +1 -1
  59. package/dist/api/resources/index.d.ts +2 -1
  60. package/dist/api/resources/index.js +3 -2
  61. package/dist/api/resources/links/client/Client.js +1 -1
  62. package/dist/api/resources/links/client/requests/CreateLinkReqUpsert.d.ts +8 -0
  63. package/dist/api/resources/links/types/CreateLinkReqUpsertClinicType.d.ts +11 -0
  64. package/dist/api/resources/links/types/CreateLinkReqUpsertClinicType.js +10 -0
  65. package/dist/api/resources/links/types/index.d.ts +1 -0
  66. package/dist/api/resources/links/types/index.js +1 -0
  67. package/dist/api/resources/notes/client/Client.js +1 -1
  68. package/dist/api/resources/offerings/client/Client.d.ts +6 -2
  69. package/dist/api/resources/offerings/client/Client.js +13 -15
  70. package/dist/api/resources/offerings/client/requests/OfferingsListRequest.d.ts +10 -6
  71. package/dist/api/resources/public/client/Client.js +1 -1
  72. package/dist/api/resources/referrals/client/Client.js +9 -9
  73. package/dist/api/resources/referrals/client/requests/CreateReferralReq.d.ts +6 -0
  74. package/dist/api/resources/referrals/index.d.ts +1 -0
  75. package/dist/api/resources/referrals/index.js +1 -0
  76. package/dist/api/resources/referrals/types/CreateReferralReqClinicType.d.ts +11 -0
  77. package/dist/api/resources/referrals/types/CreateReferralReqClinicType.js +10 -0
  78. package/dist/api/resources/referrals/types/index.d.ts +1 -0
  79. package/dist/api/resources/referrals/types/index.js +17 -0
  80. package/dist/api/resources/webhooks/client/Client.js +2 -2
  81. package/dist/api/types/AdditionalReferralField.d.ts +2 -1
  82. package/dist/api/types/AdditionalReferralField.js +1 -0
  83. package/dist/api/types/AppointmentDto.d.ts +12 -0
  84. package/dist/api/types/AppointmentDto.js +5 -0
  85. package/dist/api/types/AppointmentDtoStatus.d.ts +11 -0
  86. package/dist/api/types/AppointmentDtoStatus.js +13 -0
  87. package/dist/api/types/CreatePatientReq.d.ts +2 -0
  88. package/dist/api/types/FullReferralDto.d.ts +7 -0
  89. package/dist/api/types/FullReferralDtoClinicType.d.ts +11 -0
  90. package/dist/api/types/FullReferralDtoClinicType.js +10 -0
  91. package/dist/api/types/GetReferralPatientDto.d.ts +2 -0
  92. package/dist/api/types/PublicReferralDto.d.ts +6 -0
  93. package/dist/api/types/PublicReferralDtoClinicType.d.ts +11 -0
  94. package/dist/api/types/PublicReferralDtoClinicType.js +10 -0
  95. package/dist/api/types/ReferralDto.d.ts +6 -0
  96. package/dist/api/types/ReferralDtoClinicType.d.ts +11 -0
  97. package/dist/api/types/ReferralDtoClinicType.js +10 -0
  98. package/dist/api/types/ReferralLinkType.d.ts +2 -1
  99. package/dist/api/types/ReferralLinkType.js +1 -0
  100. package/dist/api/types/ReferrerIdType.d.ts +2 -1
  101. package/dist/api/types/ReferrerIdType.js +1 -0
  102. package/dist/api/types/UpdateEmailAckOfferingReq.d.ts +9 -0
  103. package/dist/api/types/UpdateEmailAckOfferingReq.js +5 -0
  104. package/dist/api/types/index.d.ts +6 -0
  105. package/dist/api/types/index.js +6 -0
  106. package/dist/browser/jsonwebtoken-stub.d.ts +5 -0
  107. package/dist/browser/jsonwebtoken-stub.js +10 -0
  108. package/dist/index.d.ts +1 -0
  109. package/dist/index.js +3 -1
  110. package/dist/version.d.ts +1 -1
  111. package/dist/version.js +1 -1
  112. package/dist/wrapper/ReferralExchangeJwtClient.d.ts +10 -0
  113. package/dist/wrapper/ReferralExchangeJwtClient.js +81 -0
  114. package/index.d.ts +1 -0
  115. package/index.js +3 -1
  116. package/package.json +6 -2
  117. package/reference.md +8 -1
  118. package/version.d.ts +1 -1
  119. package/version.js +1 -1
  120. package/wrapper/ReferralExchangeJwtClient.d.ts +10 -0
  121. package/wrapper/ReferralExchangeJwtClient.js +81 -0
@@ -21,6 +21,12 @@ export interface FullReferralDto {
21
21
  attachments: ReferralExchange.AttachmentDto[];
22
22
  /** URL to view the referral */
23
23
  url?: string;
24
+ /** Clinic license number */
25
+ clinicLicenseNumber?: string;
26
+ /** Clinic type */
27
+ clinicType?: ReferralExchange.FullReferralDtoClinicType;
28
+ /** Any clinical information that is relevant to the referral, e.g. medical history, drug allergies, treatment provided, etc. */
29
+ clinicalInfo?: string;
24
30
  status: ReferralExchange.FullReferralDtoStatus;
25
31
  /** Timeslot start time (ISO datetime) */
26
32
  timeslotStartAt?: string;
@@ -29,4 +35,5 @@ export interface FullReferralDto {
29
35
  notes: ReferralExchange.NoteDto[];
30
36
  timelineEvents: ReferralExchange.TimelineEventDto[];
31
37
  links: ReferralExchange.ReferralLinkDto[];
38
+ appointments: ReferralExchange.AppointmentDto[];
32
39
  }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * Clinic type
6
+ */
7
+ export type FullReferralDtoClinicType = "CHAS-only" | "CHAS and HSG";
8
+ export declare const FullReferralDtoClinicType: {
9
+ readonly ChasOnly: "CHAS-only";
10
+ readonly ChasAndHsg: "CHAS and HSG";
11
+ };
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.FullReferralDtoClinicType = void 0;
7
+ exports.FullReferralDtoClinicType = {
8
+ ChasOnly: "CHAS-only",
9
+ ChasAndHsg: "CHAS and HSG",
10
+ };
@@ -16,6 +16,8 @@ export interface GetReferralPatientDto {
16
16
  address?: ReferralExchange.CreateAddressReq;
17
17
  /** Patient residential status */
18
18
  residentialStatus?: ReferralExchange.GetReferralPatientDtoResidentialStatus;
19
+ /** Patient Healthier SG (HSG) enrolment status */
20
+ isHsgEnrolled?: boolean;
19
21
  /** Current CHAS status */
20
22
  chasStatus: string;
21
23
  }
@@ -21,4 +21,10 @@ export interface PublicReferralDto {
21
21
  attachments: ReferralExchange.AttachmentDto[];
22
22
  /** URL to view the referral */
23
23
  url?: string;
24
+ /** Clinic license number */
25
+ clinicLicenseNumber?: string;
26
+ /** Clinic type */
27
+ clinicType?: ReferralExchange.PublicReferralDtoClinicType;
28
+ /** Any clinical information that is relevant to the referral, e.g. medical history, drug allergies, treatment provided, etc. */
29
+ clinicalInfo?: string;
24
30
  }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * Clinic type
6
+ */
7
+ export type PublicReferralDtoClinicType = "CHAS-only" | "CHAS and HSG";
8
+ export declare const PublicReferralDtoClinicType: {
9
+ readonly ChasOnly: "CHAS-only";
10
+ readonly ChasAndHsg: "CHAS and HSG";
11
+ };
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.PublicReferralDtoClinicType = void 0;
7
+ exports.PublicReferralDtoClinicType = {
8
+ ChasOnly: "CHAS-only",
9
+ ChasAndHsg: "CHAS and HSG",
10
+ };
@@ -21,6 +21,12 @@ export interface ReferralDto {
21
21
  attachments: ReferralExchange.AttachmentDto[];
22
22
  /** URL to view the referral */
23
23
  url?: string;
24
+ /** Clinic license number */
25
+ clinicLicenseNumber?: string;
26
+ /** Clinic type */
27
+ clinicType?: ReferralExchange.ReferralDtoClinicType;
28
+ /** Any clinical information that is relevant to the referral, e.g. medical history, drug allergies, treatment provided, etc. */
29
+ clinicalInfo?: string;
24
30
  status: ReferralExchange.ReferralDtoStatus;
25
31
  /** Timeslot start time (ISO datetime) */
26
32
  timeslotStartAt?: string;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * Clinic type
6
+ */
7
+ export type ReferralDtoClinicType = "CHAS-only" | "CHAS and HSG";
8
+ export declare const ReferralDtoClinicType: {
9
+ readonly ChasOnly: "CHAS-only";
10
+ readonly ChasAndHsg: "CHAS and HSG";
11
+ };
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.ReferralDtoClinicType = void 0;
7
+ exports.ReferralDtoClinicType = {
8
+ ChasOnly: "CHAS-only",
9
+ ChasAndHsg: "CHAS and HSG",
10
+ };
@@ -4,9 +4,10 @@
4
4
  /**
5
5
  * type of referral link
6
6
  */
7
- export type ReferralLinkType = "upsert" | "amend" | "select-timeslot";
7
+ export type ReferralLinkType = "upsert" | "amend" | "select-timeslot" | "fill-singhealth-formsg";
8
8
  export declare const ReferralLinkType: {
9
9
  readonly Upsert: "upsert";
10
10
  readonly Amend: "amend";
11
11
  readonly SelectTimeslot: "select-timeslot";
12
+ readonly FillSinghealthFormsg: "fill-singhealth-formsg";
12
13
  };
@@ -8,4 +8,5 @@ exports.ReferralLinkType = {
8
8
  Upsert: "upsert",
9
9
  Amend: "amend",
10
10
  SelectTimeslot: "select-timeslot",
11
+ FillSinghealthFormsg: "fill-singhealth-formsg",
11
12
  };
@@ -4,10 +4,11 @@
4
4
  /**
5
5
  * Type of ID specified in referrerId.
6
6
  */
7
- export type ReferrerIdType = "mcr" | "nric" | "email" | "brightUserId";
7
+ export type ReferrerIdType = "mcr" | "nric" | "email" | "brightUserId" | "dcr";
8
8
  export declare const ReferrerIdType: {
9
9
  readonly Mcr: "mcr";
10
10
  readonly Nric: "nric";
11
11
  readonly Email: "email";
12
12
  readonly BrightUserId: "brightUserId";
13
+ readonly Dcr: "dcr";
13
14
  };
@@ -9,4 +9,5 @@ exports.ReferrerIdType = {
9
9
  Nric: "nric",
10
10
  Email: "email",
11
11
  BrightUserId: "brightUserId",
12
+ Dcr: "dcr",
12
13
  };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface UpdateEmailAckOfferingReq {
5
+ /** Destination email list for the EmailAck offering */
6
+ destinationEmails?: string[];
7
+ /** Activity status of the offering */
8
+ isActive?: boolean;
9
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -22,6 +22,7 @@ export * from "./FormResponse";
22
22
  export * from "./Form";
23
23
  export * from "./AttachmentDto";
24
24
  export * from "./NoteDto";
25
+ export * from "./ReferralDtoClinicType";
25
26
  export * from "./ReferralDtoStatus";
26
27
  export * from "./ReferralDto";
27
28
  export * from "./PaginatedQuery";
@@ -33,6 +34,9 @@ export * from "./TimelineEventDtoSystem";
33
34
  export * from "./TimelineEventDto";
34
35
  export * from "./ReferralLinkType";
35
36
  export * from "./ReferralLinkDto";
37
+ export * from "./AppointmentDtoStatus";
38
+ export * from "./AppointmentDto";
39
+ export * from "./FullReferralDtoClinicType";
36
40
  export * from "./FullReferralDtoStatus";
37
41
  export * from "./FullReferralDto";
38
42
  export * from "./CreatePatientReqGender";
@@ -40,9 +44,11 @@ export * from "./CreatePatientReqResidentialStatus";
40
44
  export * from "./CreatePatientReq";
41
45
  export * from "./OfferingWithAllowedDto";
42
46
  export * from "./Timeslot";
47
+ export * from "./UpdateEmailAckOfferingReq";
43
48
  export * from "./TriggerEmailReminderBody";
44
49
  export * from "./FormMetadata";
45
50
  export * from "./CreateReferralFormReq";
51
+ export * from "./PublicReferralDtoClinicType";
46
52
  export * from "./PublicReferralDto";
47
53
  export * from "./UpdateAacReq";
48
54
  export * from "./UpdateAacBoundaryReq";
@@ -38,6 +38,7 @@ __exportStar(require("./FormResponse"), exports);
38
38
  __exportStar(require("./Form"), exports);
39
39
  __exportStar(require("./AttachmentDto"), exports);
40
40
  __exportStar(require("./NoteDto"), exports);
41
+ __exportStar(require("./ReferralDtoClinicType"), exports);
41
42
  __exportStar(require("./ReferralDtoStatus"), exports);
42
43
  __exportStar(require("./ReferralDto"), exports);
43
44
  __exportStar(require("./PaginatedQuery"), exports);
@@ -49,6 +50,9 @@ __exportStar(require("./TimelineEventDtoSystem"), exports);
49
50
  __exportStar(require("./TimelineEventDto"), exports);
50
51
  __exportStar(require("./ReferralLinkType"), exports);
51
52
  __exportStar(require("./ReferralLinkDto"), exports);
53
+ __exportStar(require("./AppointmentDtoStatus"), exports);
54
+ __exportStar(require("./AppointmentDto"), exports);
55
+ __exportStar(require("./FullReferralDtoClinicType"), exports);
52
56
  __exportStar(require("./FullReferralDtoStatus"), exports);
53
57
  __exportStar(require("./FullReferralDto"), exports);
54
58
  __exportStar(require("./CreatePatientReqGender"), exports);
@@ -56,9 +60,11 @@ __exportStar(require("./CreatePatientReqResidentialStatus"), exports);
56
60
  __exportStar(require("./CreatePatientReq"), exports);
57
61
  __exportStar(require("./OfferingWithAllowedDto"), exports);
58
62
  __exportStar(require("./Timeslot"), exports);
63
+ __exportStar(require("./UpdateEmailAckOfferingReq"), exports);
59
64
  __exportStar(require("./TriggerEmailReminderBody"), exports);
60
65
  __exportStar(require("./FormMetadata"), exports);
61
66
  __exportStar(require("./CreateReferralFormReq"), exports);
67
+ __exportStar(require("./PublicReferralDtoClinicType"), exports);
62
68
  __exportStar(require("./PublicReferralDto"), exports);
63
69
  __exportStar(require("./UpdateAacReq"), exports);
64
70
  __exportStar(require("./UpdateAacBoundaryReq"), exports);
@@ -0,0 +1,5 @@
1
+ interface JsonWebTokenStub {
2
+ sign: () => never;
3
+ }
4
+ declare const jsonwebtokenStub: JsonWebTokenStub;
5
+ export default jsonwebtokenStub;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const browserOnlyMessage = "ReferralExchangeJwtClient is only supported in Node.js environments. " +
4
+ "The browser build intentionally excludes the jsonwebtoken dependency.";
5
+ const jsonwebtokenStub = {
6
+ sign() {
7
+ throw new Error(browserOnlyMessage);
8
+ },
9
+ };
10
+ exports.default = jsonwebtokenStub;
@@ -34,6 +34,9 @@ export declare class Eligibility {
34
34
  *
35
35
  * @example
36
36
  * await client.eligibility.get({
37
+ * referrerId: "referrerId",
38
+ * referrerIdType: "mcr",
39
+ * referrerInstitutionId: "referrerInstitutionId",
37
40
  * uin: "uin",
38
41
  * offeringId: "offeringId"
39
42
  * })
@@ -66,6 +66,9 @@ class Eligibility {
66
66
  *
67
67
  * @example
68
68
  * await client.eligibility.get({
69
+ * referrerId: "referrerId",
70
+ * referrerIdType: "mcr",
71
+ * referrerInstitutionId: "referrerInstitutionId",
69
72
  * uin: "uin",
70
73
  * offeringId: "offeringId"
71
74
  * })
@@ -75,15 +78,9 @@ class Eligibility {
75
78
  var _a, _b, _c;
76
79
  const { referrerId, referrerIdType, referrerInstitutionId, patientPostalCode, uin, offeringId } = request;
77
80
  const _queryParams = {};
78
- if (referrerId != null) {
79
- _queryParams["referrerId"] = referrerId;
80
- }
81
- if (referrerIdType != null) {
82
- _queryParams["referrerIdType"] = referrerIdType;
83
- }
84
- if (referrerInstitutionId != null) {
85
- _queryParams["referrerInstitutionId"] = referrerInstitutionId;
86
- }
81
+ _queryParams["referrerId"] = referrerId;
82
+ _queryParams["referrerIdType"] = referrerIdType;
83
+ _queryParams["referrerInstitutionId"] = referrerInstitutionId;
87
84
  if (patientPostalCode != null) {
88
85
  _queryParams["patientPostalCode"] = patientPostalCode;
89
86
  }
@@ -92,7 +89,7 @@ class Eligibility {
92
89
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
93
90
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ReferralExchangeEnvironment.SmartCms, "api/v1/eligibility"),
94
91
  method: "GET",
95
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.0-develop-1759151439", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-1759151439", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
92
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.54", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.54", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
96
93
  contentType: "application/json",
97
94
  queryParameters: _queryParams,
98
95
  requestType: "json",
@@ -5,20 +5,23 @@ import * as ReferralExchange from "../../../../index";
5
5
  /**
6
6
  * @example
7
7
  * {
8
+ * referrerId: "referrerId",
9
+ * referrerIdType: "mcr",
10
+ * referrerInstitutionId: "referrerInstitutionId",
8
11
  * uin: "uin",
9
12
  * offeringId: "offeringId"
10
13
  * }
11
14
  */
12
15
  export interface EligibilityGetRequest {
13
16
  /**
14
- * ID of the referring individual. Use together with `referralIdType` and `referrerInstitutionId` to filter based on referrer.
17
+ * ID of the referring individual.
15
18
  */
16
- referrerId?: string;
17
- referrerIdType?: ReferralExchange.ReferrerIdType;
19
+ referrerId: string;
20
+ referrerIdType: ReferralExchange.ReferrerIdType;
18
21
  /**
19
- * ID of the referring institution. Use together with `referrerId` and `referrerIdType` to filter based on referrer.
22
+ * ID of the referring institution.
20
23
  */
21
- referrerInstitutionId?: string;
24
+ referrerInstitutionId: string;
22
25
  /**
23
26
  * Postal code of the patient
24
27
  */
@@ -69,7 +69,7 @@ class Health {
69
69
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
70
70
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ReferralExchangeEnvironment.SmartCms, "api/v1/health"),
71
71
  method: "GET",
72
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.0-develop-1759151439", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-1759151439", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
72
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.54", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.54", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
73
73
  contentType: "application/json",
74
74
  requestType: "json",
75
75
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -1,7 +1,8 @@
1
+ export * as referrals from "./referrals";
2
+ export * from "./referrals/types";
1
3
  export * as links from "./links";
2
4
  export * from "./links/types";
3
5
  export * as eligibility from "./eligibility";
4
- export * as referrals from "./referrals";
5
6
  export * as notes from "./notes";
6
7
  export * as offerings from "./offerings";
7
8
  export * as public_ from "./public";
@@ -36,11 +36,12 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
36
36
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.health = exports.webhooks = exports.public_ = exports.offerings = exports.notes = exports.referrals = exports.eligibility = exports.links = void 0;
39
+ exports.health = exports.webhooks = exports.public_ = exports.offerings = exports.notes = exports.eligibility = exports.links = exports.referrals = void 0;
40
+ exports.referrals = __importStar(require("./referrals"));
41
+ __exportStar(require("./referrals/types"), exports);
40
42
  exports.links = __importStar(require("./links"));
41
43
  __exportStar(require("./links/types"), exports);
42
44
  exports.eligibility = __importStar(require("./eligibility"));
43
- exports.referrals = __importStar(require("./referrals"));
44
45
  exports.notes = __importStar(require("./notes"));
45
46
  exports.offerings = __importStar(require("./offerings"));
46
47
  exports.public_ = __importStar(require("./public"));
@@ -79,7 +79,7 @@ class Links {
79
79
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
80
80
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ReferralExchangeEnvironment.SmartCms, "api/v1/links/upsert"),
81
81
  method: "POST",
82
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.0-develop-1759151439", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-1759151439", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
82
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.54", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.54", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
83
83
  contentType: "application/json",
84
84
  requestType: "json",
85
85
  body: request,
@@ -39,4 +39,12 @@ export interface CreateLinkReqUpsert {
39
39
  address?: ReferralExchange.CreateAddressReq;
40
40
  /** Patient residential status */
41
41
  residentialStatus?: ReferralExchange.CreateLinkReqUpsertResidentialStatus;
42
+ /** Patient Healthier SG (HSG) enrolment status */
43
+ isPatientHsgEnrolled?: boolean;
44
+ /** Clinic license number */
45
+ clinicLicenseNumber?: string;
46
+ /** Clinic type */
47
+ clinicType?: ReferralExchange.CreateLinkReqUpsertClinicType;
48
+ /** Any clinical information that is relevant to the referral, e.g. medical history, drug allergies, treatment provided, etc. */
49
+ clinicalInfo?: string;
42
50
  }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * Clinic type
6
+ */
7
+ export type CreateLinkReqUpsertClinicType = "CHAS-only" | "CHAS and HSG";
8
+ export declare const CreateLinkReqUpsertClinicType: {
9
+ readonly ChasOnly: "CHAS-only";
10
+ readonly ChasAndHsg: "CHAS and HSG";
11
+ };
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.CreateLinkReqUpsertClinicType = void 0;
7
+ exports.CreateLinkReqUpsertClinicType = {
8
+ ChasOnly: "CHAS-only",
9
+ ChasAndHsg: "CHAS and HSG",
10
+ };
@@ -1,2 +1,3 @@
1
1
  export * from "./CreateLinkReqUpsertPatientGender";
2
2
  export * from "./CreateLinkReqUpsertResidentialStatus";
3
+ export * from "./CreateLinkReqUpsertClinicType";
@@ -16,3 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./CreateLinkReqUpsertPatientGender"), exports);
18
18
  __exportStar(require("./CreateLinkReqUpsertResidentialStatus"), exports);
19
+ __exportStar(require("./CreateLinkReqUpsertClinicType"), exports);
@@ -76,7 +76,7 @@ class Notes {
76
76
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
77
77
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ReferralExchangeEnvironment.SmartCms, `api/v1/referrals/${encodeURIComponent(referralId)}/notes`),
78
78
  method: "POST",
79
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.0-develop-1759151439", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-1759151439", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
79
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.54", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.54", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
80
80
  contentType: "application/json",
81
81
  requestType: "json",
82
82
  body: request,
@@ -33,9 +33,13 @@ export declare class Offerings {
33
33
  * @throws {@link ReferralExchange.UnauthorizedError}
34
34
  *
35
35
  * @example
36
- * await client.offerings.list()
36
+ * await client.offerings.list({
37
+ * referrerId: "referrerId",
38
+ * referrerIdType: "mcr",
39
+ * referrerInstitutionId: "referrerInstitutionId"
40
+ * })
37
41
  */
38
- list(request?: ReferralExchange.OfferingsListRequest, requestOptions?: Offerings.RequestOptions): Promise<ReferralExchange.OfferingWithAllowedDto[]>;
42
+ list(request: ReferralExchange.OfferingsListRequest, requestOptions?: Offerings.RequestOptions): Promise<ReferralExchange.OfferingWithAllowedDto[]>;
39
43
  /**
40
44
  * @param {ReferralExchange.ApiHoldingControllerGetRecommendedOfferingRequest} request
41
45
  * @param {Offerings.RequestOptions} requestOptions - Request-specific configuration.
@@ -65,29 +65,27 @@ class Offerings {
65
65
  * @throws {@link ReferralExchange.UnauthorizedError}
66
66
  *
67
67
  * @example
68
- * await client.offerings.list()
68
+ * await client.offerings.list({
69
+ * referrerId: "referrerId",
70
+ * referrerIdType: "mcr",
71
+ * referrerInstitutionId: "referrerInstitutionId"
72
+ * })
69
73
  */
70
- list() {
71
- return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
74
+ list(request, requestOptions) {
75
+ return __awaiter(this, void 0, void 0, function* () {
72
76
  var _a, _b, _c;
73
77
  const { referrerId, referrerIdType, referrerInstitutionId, patientPostalCode } = request;
74
78
  const _queryParams = {};
75
- if (referrerId != null) {
76
- _queryParams["referrerId"] = referrerId;
77
- }
78
- if (referrerIdType != null) {
79
- _queryParams["referrerIdType"] = referrerIdType;
80
- }
81
- if (referrerInstitutionId != null) {
82
- _queryParams["referrerInstitutionId"] = referrerInstitutionId;
83
- }
79
+ _queryParams["referrerId"] = referrerId;
80
+ _queryParams["referrerIdType"] = referrerIdType;
81
+ _queryParams["referrerInstitutionId"] = referrerInstitutionId;
84
82
  if (patientPostalCode != null) {
85
83
  _queryParams["patientPostalCode"] = patientPostalCode;
86
84
  }
87
85
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
88
86
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ReferralExchangeEnvironment.SmartCms, "api/v1/offerings"),
89
87
  method: "GET",
90
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.0-develop-1759151439", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-1759151439", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
88
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.54", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.54", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
91
89
  contentType: "application/json",
92
90
  queryParameters: _queryParams,
93
91
  requestType: "json",
@@ -146,7 +144,7 @@ class Offerings {
146
144
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
147
145
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ReferralExchangeEnvironment.SmartCms, "api/v1/offerings/recommended"),
148
146
  method: "GET",
149
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.0-develop-1759151439", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-1759151439", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
147
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.54", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.54", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
150
148
  contentType: "application/json",
151
149
  queryParameters: _queryParams,
152
150
  requestType: "json",
@@ -209,7 +207,7 @@ class Offerings {
209
207
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
210
208
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ReferralExchangeEnvironment.SmartCms, `api/v1/offerings/${encodeURIComponent(offeringId)}/timeslots`),
211
209
  method: "GET",
212
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.0-develop-1759151439", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-1759151439", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
210
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.54", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.54", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
213
211
  contentType: "application/json",
214
212
  queryParameters: _queryParams,
215
213
  requestType: "json",
@@ -4,18 +4,22 @@
4
4
  import * as ReferralExchange from "../../../../index";
5
5
  /**
6
6
  * @example
7
- * {}
7
+ * {
8
+ * referrerId: "referrerId",
9
+ * referrerIdType: "mcr",
10
+ * referrerInstitutionId: "referrerInstitutionId"
11
+ * }
8
12
  */
9
13
  export interface OfferingsListRequest {
10
14
  /**
11
- * ID of the referring individual. Use together with `referralIdType` and `referrerInstitutionId` to filter based on referrer.
15
+ * ID of the referring individual.
12
16
  */
13
- referrerId?: string;
14
- referrerIdType?: ReferralExchange.ReferrerIdType;
17
+ referrerId: string;
18
+ referrerIdType: ReferralExchange.ReferrerIdType;
15
19
  /**
16
- * ID of the referring institution. Use together with `referrerId` and `referrerIdType` to filter based on referrer.
20
+ * ID of the referring institution.
17
21
  */
18
- referrerInstitutionId?: string;
22
+ referrerInstitutionId: string;
19
23
  /**
20
24
  * Postal code of the patient
21
25
  */
@@ -84,7 +84,7 @@ class Public {
84
84
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
85
85
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ReferralExchangeEnvironment.SmartCms, `api/v1/public/referrals/${encodeURIComponent(referralId)}`),
86
86
  method: "GET",
87
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.0-develop-1759151439", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.0-develop-1759151439", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
87
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@opengovsg/refx-ts-sdk", "X-Fern-SDK-Version": "0.0.54", "User-Agent": "@opengovsg/refx-ts-sdk/0.0.54", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
88
88
  contentType: "application/json",
89
89
  queryParameters: _queryParams,
90
90
  requestType: "json",