@icure/api 5.1.18 → 5.1.20
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/icc-api/index.d.ts +0 -1
- package/icc-api/index.js +0 -1
- package/icc-api/index.js.map +1 -1
- package/icc-api/model/FlatRateTarification.d.ts +4 -1
- package/icc-api/model/FlatRateTarification.js +3 -0
- package/icc-api/model/FlatRateTarification.js.map +1 -1
- package/icc-x-api/auth/EnsembleAuthService.js +5 -0
- package/icc-x-api/auth/EnsembleAuthService.js.map +1 -1
- package/package.json +1 -1
- package/icc-api/api/IccBemikronoApi.d.ts +0 -81
- package/icc-api/api/IccBemikronoApi.js +0 -162
- package/icc-api/api/IccBemikronoApi.js.map +0 -1
package/icc-api/index.d.ts
CHANGED
|
@@ -6,7 +6,6 @@ export * from './api/IccArticleApi';
|
|
|
6
6
|
export * from './api/IccAuthApi';
|
|
7
7
|
export * from './api/IccBeefactApi';
|
|
8
8
|
export * from './api/IccBekmehrApi';
|
|
9
|
-
export * from './api/IccBemikronoApi';
|
|
10
9
|
export * from './api/IccBeresultexportApi';
|
|
11
10
|
export * from './api/IccBeresultimportApi';
|
|
12
11
|
export * from './api/IccBesamv2Api';
|
package/icc-api/index.js
CHANGED
|
@@ -22,7 +22,6 @@ __exportStar(require("./api/IccArticleApi"), exports);
|
|
|
22
22
|
__exportStar(require("./api/IccAuthApi"), exports);
|
|
23
23
|
__exportStar(require("./api/IccBeefactApi"), exports);
|
|
24
24
|
__exportStar(require("./api/IccBekmehrApi"), exports);
|
|
25
|
-
__exportStar(require("./api/IccBemikronoApi"), exports);
|
|
26
25
|
__exportStar(require("./api/IccBeresultexportApi"), exports);
|
|
27
26
|
__exportStar(require("./api/IccBeresultimportApi"), exports);
|
|
28
27
|
__exportStar(require("./api/IccBesamv2Api"), exports);
|
package/icc-api/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../icc-api/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wDAAqC;AACrC,qDAAkC;AAClC,8DAA2C;AAC3C,kEAA+C;AAC/C,sDAAmC;AACnC,mDAAgC;AAChC,sDAAmC;AACnC,sDAAmC;AACnC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../icc-api/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wDAAqC;AACrC,qDAAkC;AAClC,8DAA2C;AAC3C,kEAA+C;AAC/C,sDAAmC;AACnC,mDAAgC;AAChC,sDAAmC;AACnC,sDAAmC;AACnC,6DAA0C;AAC1C,6DAA0C;AAC1C,sDAAmC;AACnC,2DAAwC;AACxC,+DAA4C;AAC5C,6DAA0C;AAC1C,qEAAkD;AAClD,mDAAgC;AAChC,sDAAmC;AACnC,qDAAkC;AAClC,0DAAuC;AACvC,uDAAoC;AACpC,wDAAqC;AACrC,6DAA0C;AAC1C,mDAAgC;AAChC,gEAA6C;AAC7C,oDAAiC;AACjC,sDAAmC;AACnC,uDAAoC;AACpC,oDAAiC;AACjC,wDAAqC;AACrC,sDAAmC;AACnC,sDAAmC;AACnC,oDAAiC;AACjC,8DAA2C;AAC3C,sDAAmC;AACnC,sDAAmC;AACnC,yDAAsC;AACtC,oDAAiC;AACjC,qDAAkC;AAClC,sDAAmC;AACnC,0DAAuC;AACvC,2DAAwC;AACxC,wDAAqC;AACrC,kDAA+B;AAC/B,mDAAgC","sourcesContent":["export * from './api/IccAccesslogApi'\nexport * from './api/IccAgendaApi'\nexport * from './api/IccAnonymousAccessApi'\nexport * from './api/IccApplicationsettingsApi'\nexport * from './api/IccArticleApi'\nexport * from './api/IccAuthApi'\nexport * from './api/IccBeefactApi'\nexport * from './api/IccBekmehrApi'\nexport * from './api/IccBeresultexportApi'\nexport * from './api/IccBeresultimportApi'\nexport * from './api/IccBesamv2Api'\nexport * from './api/IccCalendarItemApi'\nexport * from './api/IccCalendarItemTypeApi'\nexport * from './api/IccClassificationApi'\nexport * from './api/IccClassificationTemplateApi'\nexport * from './api/IccCodeApi'\nexport * from './api/IccContactApi'\nexport * from './api/IccDeviceApi'\nexport * from './api/IccDoctemplateApi'\nexport * from './api/IccDocumentApi'\nexport * from './api/IccEntityrefApi'\nexport * from './api/IccEntitytemplateApi'\nexport * from './api/IccFormApi'\nexport * from './api/IccFrontendmigrationApi'\nexport * from './api/IccGroupApi'\nexport * from './api/IccHcpartyApi'\nexport * from './api/IccHelementApi'\nexport * from './api/IccIcureApi'\nexport * from './api/IccInsuranceApi'\nexport * from './api/IccInvoiceApi'\nexport * from './api/IccKeywordApi'\nexport * from './api/IccMedexApi'\nexport * from './api/IccMedicallocationApi'\nexport * from './api/IccMessageApi'\nexport * from './api/IccPatientApi'\nexport * from './api/IccPermissionApi'\nexport * from './api/IccPlaceApi'\nexport * from './api/IccPubsubApi'\nexport * from './api/IccReceiptApi'\nexport * from './api/IccReplicationApi'\nexport * from './api/IccTarificationApi'\nexport * from './api/IccTimeTableApi'\nexport * from './api/IccTmpApi'\nexport * from './api/IccUserApi'\n"]}
|
|
@@ -24,11 +24,14 @@ export declare class FlatRateTarification {
|
|
|
24
24
|
encryptedSelf?: string;
|
|
25
25
|
}
|
|
26
26
|
export declare namespace FlatRateTarification {
|
|
27
|
-
type FlatRateTypeEnum = 'physician' | 'physiotherapist' | 'nurse' | 'ptd';
|
|
27
|
+
type FlatRateTypeEnum = 'physician' | 'physiotherapist' | 'nurse' | 'ptd' | 'ivgFlatRate1' | 'ivgFlatRate2' | 'ivgPersonalIntervention';
|
|
28
28
|
const FlatRateTypeEnum: {
|
|
29
29
|
Physician: FlatRateTypeEnum;
|
|
30
30
|
Physiotherapist: FlatRateTypeEnum;
|
|
31
31
|
Nurse: FlatRateTypeEnum;
|
|
32
32
|
Ptd: FlatRateTypeEnum;
|
|
33
|
+
IvgFlatRate1: FlatRateTypeEnum;
|
|
34
|
+
IvgFlatRate2: FlatRateTypeEnum;
|
|
35
|
+
IvgPersonalIntervention: FlatRateTypeEnum;
|
|
33
36
|
};
|
|
34
37
|
}
|
|
@@ -13,6 +13,9 @@ exports.FlatRateTarification = FlatRateTarification;
|
|
|
13
13
|
Physiotherapist: 'physiotherapist',
|
|
14
14
|
Nurse: 'nurse',
|
|
15
15
|
Ptd: 'ptd',
|
|
16
|
+
IvgFlatRate1: 'ivgFlatRate1',
|
|
17
|
+
IvgFlatRate2: 'ivgFlatRate2',
|
|
18
|
+
IvgPersonalIntervention: 'ivgPersonalIntervention',
|
|
16
19
|
};
|
|
17
20
|
})(FlatRateTarification = exports.FlatRateTarification || (exports.FlatRateTarification = {}));
|
|
18
21
|
//# sourceMappingURL=FlatRateTarification.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlatRateTarification.js","sourceRoot":"","sources":["../../../icc-api/model/FlatRateTarification.ts"],"names":[],"mappings":";;;AAaA,MAAa,oBAAoB;IAC/B,YAAY,IAAgB;QAC1B,MAAM,CAAC,MAAM,CAAC,IAA4B,EAAE,IAAI,CAAC,CAAA;IACnD,CAAC;CAUF;AAbD,oDAaC;AACD,WAAiB,oBAAoB;IAEtB,qCAAgB,GAAG;QAC9B,SAAS,EAAE,WAA+B;QAC1C,eAAe,EAAE,iBAAqC;QACtD,KAAK,EAAE,OAA2B;QAClC,GAAG,EAAE,KAAyB;
|
|
1
|
+
{"version":3,"file":"FlatRateTarification.js","sourceRoot":"","sources":["../../../icc-api/model/FlatRateTarification.ts"],"names":[],"mappings":";;;AAaA,MAAa,oBAAoB;IAC/B,YAAY,IAAgB;QAC1B,MAAM,CAAC,MAAM,CAAC,IAA4B,EAAE,IAAI,CAAC,CAAA;IACnD,CAAC;CAUF;AAbD,oDAaC;AACD,WAAiB,oBAAoB;IAEtB,qCAAgB,GAAG;QAC9B,SAAS,EAAE,WAA+B;QAC1C,eAAe,EAAE,iBAAqC;QACtD,KAAK,EAAE,OAA2B;QAClC,GAAG,EAAE,KAAyB;QAC9B,YAAY,EAAE,cAAkC;QAChD,YAAY,EAAE,cAAkC;QAChD,uBAAuB,EAAE,yBAA6C;KACvE,CAAA;AACH,CAAC,EAXgB,oBAAoB,GAApB,4BAAoB,KAApB,4BAAoB,QAWpC","sourcesContent":["/**\n * iCure Data Stack API Documentation\n * The iCure Data Stack Application API is the native interface to iCure. This version is obsolete, please use v2.\n *\n * OpenAPI spec version: v1\n *\n *\n * NOTE: This class is auto generated by the swagger code generator program.\n * https://github.com/swagger-api/swagger-codegen.git\n * Do not edit the class manually.\n */\nimport { Valorisation } from './Valorisation'\n\nexport class FlatRateTarification {\n constructor(json: JSON | any) {\n Object.assign(this as FlatRateTarification, json)\n }\n\n code?: string\n flatRateType?: FlatRateTarification.FlatRateTypeEnum\n label?: { [key: string]: string }\n valorisations?: Array<Valorisation>\n /**\n * The base64 encoded data of this object, formatted as JSON and encrypted in AES using the random master key from encryptionKeys.\n */\n encryptedSelf?: string\n}\nexport namespace FlatRateTarification {\n export type FlatRateTypeEnum = 'physician' | 'physiotherapist' | 'nurse' | 'ptd' | 'ivgFlatRate1' | 'ivgFlatRate2' | 'ivgPersonalIntervention'\n export const FlatRateTypeEnum = {\n Physician: 'physician' as FlatRateTypeEnum,\n Physiotherapist: 'physiotherapist' as FlatRateTypeEnum,\n Nurse: 'nurse' as FlatRateTypeEnum,\n Ptd: 'ptd' as FlatRateTypeEnum,\n IvgFlatRate1: 'ivgFlatRate1' as FlatRateTypeEnum,\n IvgFlatRate2: 'ivgFlatRate2' as FlatRateTypeEnum,\n IvgPersonalIntervention: 'ivgPersonalIntervention' as FlatRateTypeEnum,\n }\n}\n"]}
|
|
@@ -10,6 +10,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.EnsembleAuthService = void 0;
|
|
13
|
+
const XHR_1 = require("../../icc-api/api/XHR");
|
|
14
|
+
var XHRError = XHR_1.XHR.XHRError;
|
|
13
15
|
class EnsembleAuthService {
|
|
14
16
|
constructor(jwtAuth, sessionAuth, basicAuth) {
|
|
15
17
|
this.jwtAuth = jwtAuth;
|
|
@@ -32,6 +34,9 @@ class EnsembleAuthService {
|
|
|
32
34
|
// And delegate the responsibility of handling the error to the next call
|
|
33
35
|
return !!this.stateMap[this.currentState].state
|
|
34
36
|
? this.stateMap[this.currentState].state.getAuthHeaders().catch((e) => {
|
|
37
|
+
if (e instanceof XHRError && e.statusCode === 417) {
|
|
38
|
+
throw e;
|
|
39
|
+
}
|
|
35
40
|
// If I get an error, it is also responsibility of the next call, but I give a warning
|
|
36
41
|
console.warn(e.message);
|
|
37
42
|
this.error = e;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnsembleAuthService.js","sourceRoot":"","sources":["../../../icc-x-api/auth/EnsembleAuthService.ts"],"names":[],"mappings":";;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"EnsembleAuthService.js","sourceRoot":"","sources":["../../../icc-x-api/auth/EnsembleAuthService.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,+CAA2C;AAK3C,IAAO,QAAQ,GAAG,SAAG,CAAC,QAAQ,CAAA;AAE9B,MAAa,mBAAmB;IAK9B,YACmB,OAA8B,EAC9B,WAA0B,EAC1B,SAA2B;QAF3B,YAAO,GAAP,OAAO,CAAuB;QAC9B,gBAAW,GAAX,WAAW,CAAe;QAC1B,cAAS,GAAT,SAAS,CAAkB;QANtC,UAAK,GAAiB,IAAI,CAAA;QAQhC,IAAI,CAAC,QAAQ,GAAG;YACd,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE;YACnC,GAAG,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE;YAC7C,OAAO,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE,IAAI,EAAE,OAAO,EAAE;YACnD,KAAK,EAAE,EAAE,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,IAAI,CAAC,CAAC,IAAI,CAAC,YAAY,EAAE;YACvB,MAAA,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,KAAK,0CAAE,gBAAgB,CAAC,KAAK,CAAC,CAAA;SAChE;IACH,CAAC;CACF;AAnDD,kDAmDC","sourcesContent":["import { AuthService } from './AuthService'\nimport { XHR } from '../../icc-api/api/XHR'\nimport { JwtAuthService } from './JwtAuthService'\nimport { NoAuthService } from './NoAuthService'\nimport { BasicAuthService } from './BasicAuthService'\nimport Header = XHR.Header\nimport XHRError = XHR.XHRError\n\nexport class EnsembleAuthService implements AuthService {\n private currentState: string | null\n private error: Error | null = null\n private stateMap: { [key: string]: { state: AuthService | null; next: string | null } }\n\n constructor(\n private readonly jwtAuth: JwtAuthService | null,\n private readonly sessionAuth: NoAuthService,\n private readonly basicAuth: BasicAuthService\n ) {\n this.stateMap = {\n start: { state: null, next: 'jwt' },\n jwt: { state: this.jwtAuth, next: 'session' },\n session: { state: this.sessionAuth, next: 'basic' },\n basic: { state: this.basicAuth, next: null },\n }\n this.currentState = 'start'\n }\n\n async getAuthHeaders(): Promise<Array<Header>> {\n this.currentState = !!this.currentState ? this.stateMap[this.currentState].next : this.currentState\n\n if (!!this.currentState) {\n // If I have a state I return the headers, otherwise I return empty headers\n // And delegate the responsibility of handling the error to the next call\n return !!this.stateMap[this.currentState].state\n ? this.stateMap[this.currentState].state!.getAuthHeaders().catch((e) => {\n if (e instanceof XHRError && e.statusCode === 417) {\n throw e\n }\n // If I get an error, it is also responsibility of the next call, but I give a warning\n console.warn(e.message)\n this.error = e\n\n return []\n })\n : Promise.resolve([])\n } else if (!!this.error) {\n // If I have no more states, I throw the last error or a default one\n throw this.error\n } else {\n throw new Error('Cannot authenticate')\n }\n }\n\n invalidateHeader(error: Error): void {\n this.error = error\n if (!!this.currentState) {\n this.stateMap[this.currentState].state?.invalidateHeader(error)\n }\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* iCure Data Stack API Documentation
|
|
3
|
-
* The iCure Data Stack Application API is the native interface to iCure. This version is obsolete, please use v2.
|
|
4
|
-
*
|
|
5
|
-
* OpenAPI spec version: v1
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* NOTE: This class is auto generated by the swagger code generator program.
|
|
9
|
-
* https://github.com/swagger-api/swagger-codegen.git
|
|
10
|
-
* Do not edit the class manually.
|
|
11
|
-
*/
|
|
12
|
-
import { XHR } from './XHR';
|
|
13
|
-
import { Appointment } from '../model/Appointment';
|
|
14
|
-
import { AppointmentImport } from '../model/AppointmentImport';
|
|
15
|
-
import { EmailOrSmsMessage } from '../model/EmailOrSmsMessage';
|
|
16
|
-
import { MikronoAppointmentTypeRest } from '../model/MikronoAppointmentTypeRest';
|
|
17
|
-
import { MikronoCredentials } from '../model/MikronoCredentials';
|
|
18
|
-
import { Unit } from '../model/Unit';
|
|
19
|
-
import { User } from '../model/User';
|
|
20
|
-
import { AuthenticationProvider } from '../../icc-x-api/auth/AuthenticationProvider';
|
|
21
|
-
export declare class IccBemikronoApi {
|
|
22
|
-
host: string;
|
|
23
|
-
headers: Array<XHR.Header>;
|
|
24
|
-
authenticationProvider: AuthenticationProvider;
|
|
25
|
-
fetchImpl?: (input: RequestInfo, init?: RequestInit) => Promise<Response>;
|
|
26
|
-
constructor(host: string, headers: any, authenticationProvider?: AuthenticationProvider, fetchImpl?: (input: RequestInfo, init?: RequestInit) => Promise<Response>);
|
|
27
|
-
setHeaders(h: Array<XHR.Header>): void;
|
|
28
|
-
handleError(e: XHR.XHRError): never;
|
|
29
|
-
/**
|
|
30
|
-
*
|
|
31
|
-
* @summary Get appointments for patient
|
|
32
|
-
* @param calendarDate
|
|
33
|
-
*/
|
|
34
|
-
appointmentsByDate(calendarDate: number): Promise<Array<Appointment>>;
|
|
35
|
-
/**
|
|
36
|
-
*
|
|
37
|
-
* @summary Get appointments for patient
|
|
38
|
-
* @param patientId
|
|
39
|
-
* @param from
|
|
40
|
-
* @param to
|
|
41
|
-
*/
|
|
42
|
-
appointmentsByPatient(patientId: string, from?: number, to?: number): Promise<Array<Appointment>>;
|
|
43
|
-
/**
|
|
44
|
-
*
|
|
45
|
-
* @param body
|
|
46
|
-
*/
|
|
47
|
-
createAppointmentTypes(body?: Array<MikronoAppointmentTypeRest>): Promise<Array<MikronoAppointmentTypeRest>>;
|
|
48
|
-
/**
|
|
49
|
-
*
|
|
50
|
-
* @summary Create appointments for owner
|
|
51
|
-
* @param body
|
|
52
|
-
*/
|
|
53
|
-
createAppointments(body?: Array<AppointmentImport>): Promise<Array<string>>;
|
|
54
|
-
/**
|
|
55
|
-
*
|
|
56
|
-
* @summary Notify of an appointment change
|
|
57
|
-
* @param appointmentId
|
|
58
|
-
* @param action
|
|
59
|
-
*/
|
|
60
|
-
notify(appointmentId: string, action: string): Promise<any | Boolean>;
|
|
61
|
-
/**
|
|
62
|
-
*
|
|
63
|
-
* @summary Set credentials for provided user
|
|
64
|
-
* @param body
|
|
65
|
-
* @param userId
|
|
66
|
-
*/
|
|
67
|
-
register(userId: string, body?: MikronoCredentials): Promise<User>;
|
|
68
|
-
/**
|
|
69
|
-
*
|
|
70
|
-
* @summary Send message using mikrono from logged user
|
|
71
|
-
* @param body
|
|
72
|
-
*/
|
|
73
|
-
sendMessage(body?: EmailOrSmsMessage): Promise<Unit>;
|
|
74
|
-
/**
|
|
75
|
-
*
|
|
76
|
-
* @summary Set credentials for provided user
|
|
77
|
-
* @param body
|
|
78
|
-
* @param userId
|
|
79
|
-
*/
|
|
80
|
-
setUserCredentials(userId: string, body?: MikronoCredentials): Promise<User>;
|
|
81
|
-
}
|
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IccBemikronoApi = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* iCure Data Stack API Documentation
|
|
6
|
-
* The iCure Data Stack Application API is the native interface to iCure. This version is obsolete, please use v2.
|
|
7
|
-
*
|
|
8
|
-
* OpenAPI spec version: v1
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* NOTE: This class is auto generated by the swagger code generator program.
|
|
12
|
-
* https://github.com/swagger-api/swagger-codegen.git
|
|
13
|
-
* Do not edit the class manually.
|
|
14
|
-
*/
|
|
15
|
-
const XHR_1 = require("./XHR");
|
|
16
|
-
const Appointment_1 = require("../model/Appointment");
|
|
17
|
-
const MikronoAppointmentTypeRest_1 = require("../model/MikronoAppointmentTypeRest");
|
|
18
|
-
const Unit_1 = require("../model/Unit");
|
|
19
|
-
const User_1 = require("../model/User");
|
|
20
|
-
const AuthenticationProvider_1 = require("../../icc-x-api/auth/AuthenticationProvider");
|
|
21
|
-
class IccBemikronoApi {
|
|
22
|
-
constructor(host, headers, authenticationProvider, fetchImpl) {
|
|
23
|
-
this.host = host;
|
|
24
|
-
this.headers = Object.keys(headers).map((k) => new XHR_1.XHR.Header(k, headers[k]));
|
|
25
|
-
this.authenticationProvider = !!authenticationProvider ? authenticationProvider : new AuthenticationProvider_1.NoAuthenticationProvider();
|
|
26
|
-
this.fetchImpl = fetchImpl;
|
|
27
|
-
}
|
|
28
|
-
setHeaders(h) {
|
|
29
|
-
this.headers = h;
|
|
30
|
-
}
|
|
31
|
-
handleError(e) {
|
|
32
|
-
throw e;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
*
|
|
36
|
-
* @summary Get appointments for patient
|
|
37
|
-
* @param calendarDate
|
|
38
|
-
*/
|
|
39
|
-
appointmentsByDate(calendarDate) {
|
|
40
|
-
let _body = null;
|
|
41
|
-
const _url = this.host + `/be_mikrono/appointments/byDate/${encodeURIComponent(String(calendarDate))}` + '?ts=' + new Date().getTime();
|
|
42
|
-
let headers = this.headers;
|
|
43
|
-
return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
44
|
-
.then((doc) => doc.body.map((it) => new Appointment_1.Appointment(it)))
|
|
45
|
-
.catch((err) => this.handleError(err));
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
*
|
|
49
|
-
* @summary Get appointments for patient
|
|
50
|
-
* @param patientId
|
|
51
|
-
* @param from
|
|
52
|
-
* @param to
|
|
53
|
-
*/
|
|
54
|
-
appointmentsByPatient(patientId, from, to) {
|
|
55
|
-
let _body = null;
|
|
56
|
-
const _url = this.host +
|
|
57
|
-
`/be_mikrono/appointments/byPatient/${encodeURIComponent(String(patientId))}` +
|
|
58
|
-
'?ts=' +
|
|
59
|
-
new Date().getTime() +
|
|
60
|
-
(from ? '&from=' + encodeURIComponent(String(from)) : '') +
|
|
61
|
-
(to ? '&to=' + encodeURIComponent(String(to)) : '');
|
|
62
|
-
let headers = this.headers;
|
|
63
|
-
return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
64
|
-
.then((doc) => doc.body.map((it) => new Appointment_1.Appointment(it)))
|
|
65
|
-
.catch((err) => this.handleError(err));
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
*
|
|
69
|
-
* @param body
|
|
70
|
-
*/
|
|
71
|
-
createAppointmentTypes(body) {
|
|
72
|
-
let _body = null;
|
|
73
|
-
_body = body;
|
|
74
|
-
const _url = this.host + `/be_mikrono/appointmentTypes` + '?ts=' + new Date().getTime();
|
|
75
|
-
let headers = this.headers;
|
|
76
|
-
headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
|
|
77
|
-
return XHR_1.XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
78
|
-
.then((doc) => doc.body.map((it) => new MikronoAppointmentTypeRest_1.MikronoAppointmentTypeRest(it)))
|
|
79
|
-
.catch((err) => this.handleError(err));
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
*
|
|
83
|
-
* @summary Create appointments for owner
|
|
84
|
-
* @param body
|
|
85
|
-
*/
|
|
86
|
-
createAppointments(body) {
|
|
87
|
-
let _body = null;
|
|
88
|
-
_body = body;
|
|
89
|
-
const _url = this.host + `/be_mikrono/appointments` + '?ts=' + new Date().getTime();
|
|
90
|
-
let headers = this.headers;
|
|
91
|
-
headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
|
|
92
|
-
return XHR_1.XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
93
|
-
.then((doc) => doc.body.map((it) => JSON.parse(JSON.stringify(it))))
|
|
94
|
-
.catch((err) => this.handleError(err));
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
*
|
|
98
|
-
* @summary Notify of an appointment change
|
|
99
|
-
* @param appointmentId
|
|
100
|
-
* @param action
|
|
101
|
-
*/
|
|
102
|
-
notify(appointmentId, action) {
|
|
103
|
-
let _body = null;
|
|
104
|
-
const _url = this.host +
|
|
105
|
-
`/be_mikrono/notify/${encodeURIComponent(String(appointmentId))}/${encodeURIComponent(String(action))}` +
|
|
106
|
-
'?ts=' +
|
|
107
|
-
new Date().getTime();
|
|
108
|
-
let headers = this.headers;
|
|
109
|
-
return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
110
|
-
.then((doc) => true)
|
|
111
|
-
.catch((err) => this.handleError(err));
|
|
112
|
-
}
|
|
113
|
-
/**
|
|
114
|
-
*
|
|
115
|
-
* @summary Set credentials for provided user
|
|
116
|
-
* @param body
|
|
117
|
-
* @param userId
|
|
118
|
-
*/
|
|
119
|
-
register(userId, body) {
|
|
120
|
-
let _body = null;
|
|
121
|
-
_body = body;
|
|
122
|
-
const _url = this.host + `/be_mikrono/user/${encodeURIComponent(String(userId))}/register` + '?ts=' + new Date().getTime();
|
|
123
|
-
let headers = this.headers;
|
|
124
|
-
headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
|
|
125
|
-
return XHR_1.XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
126
|
-
.then((doc) => new User_1.User(doc.body))
|
|
127
|
-
.catch((err) => this.handleError(err));
|
|
128
|
-
}
|
|
129
|
-
/**
|
|
130
|
-
*
|
|
131
|
-
* @summary Send message using mikrono from logged user
|
|
132
|
-
* @param body
|
|
133
|
-
*/
|
|
134
|
-
sendMessage(body) {
|
|
135
|
-
let _body = null;
|
|
136
|
-
_body = body;
|
|
137
|
-
const _url = this.host + `/be_mikrono/sendMessage` + '?ts=' + new Date().getTime();
|
|
138
|
-
let headers = this.headers;
|
|
139
|
-
headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
|
|
140
|
-
return XHR_1.XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
141
|
-
.then((doc) => new Unit_1.Unit(doc.body))
|
|
142
|
-
.catch((err) => this.handleError(err));
|
|
143
|
-
}
|
|
144
|
-
/**
|
|
145
|
-
*
|
|
146
|
-
* @summary Set credentials for provided user
|
|
147
|
-
* @param body
|
|
148
|
-
* @param userId
|
|
149
|
-
*/
|
|
150
|
-
setUserCredentials(userId, body) {
|
|
151
|
-
let _body = null;
|
|
152
|
-
_body = body;
|
|
153
|
-
const _url = this.host + `/be_mikrono/user/${encodeURIComponent(String(userId))}/credentials` + '?ts=' + new Date().getTime();
|
|
154
|
-
let headers = this.headers;
|
|
155
|
-
headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
|
|
156
|
-
return XHR_1.XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
157
|
-
.then((doc) => new User_1.User(doc.body))
|
|
158
|
-
.catch((err) => this.handleError(err));
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
exports.IccBemikronoApi = IccBemikronoApi;
|
|
162
|
-
//# sourceMappingURL=IccBemikronoApi.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IccBemikronoApi.js","sourceRoot":"","sources":["../../../icc-api/api/IccBemikronoApi.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;GAUG;AACH,+BAA2B;AAC3B,sDAAkD;AAGlD,oFAAgF;AAEhF,wCAAoC;AACpC,wCAAoC;AACpC,wFAA8G;AAE9G,MAAa,eAAe;IAM1B,YACE,IAAY,EACZ,OAAY,EACZ,sBAA+C,EAC/C,SAAyE;QAEzE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,SAAG,CAAC,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;QAC7E,IAAI,CAAC,sBAAsB,GAAG,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,IAAI,iDAAwB,EAAE,CAAA;QAChH,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;IAC5B,CAAC;IAED,UAAU,CAAC,CAAoB;QAC7B,IAAI,CAAC,OAAO,GAAG,CAAC,CAAA;IAClB,CAAC;IAED,WAAW,CAAC,CAAe;QACzB,MAAM,CAAC,CAAA;IACT,CAAC;IAED;;;;OAIG;IACH,kBAAkB,CAAC,YAAoB;QACrC,IAAI,KAAK,GAAG,IAAI,CAAA;QAEhB,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,GAAG,mCAAmC,kBAAkB,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,EAAE,GAAG,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO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C,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,cAAc,CAAC,CAAC,MAAM,CAAC,IAAI,SAAG,CAAC,MAAM,CAAC,cAAc,EAAE,kBAAkB,CAAC,CAAC,CAAA;QACvH,OAAO,SAAG,CAAC,WAAW,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,CAAC,sBAAsB,CAAC,cAAc,EAAE,CAAC;aACzH,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,WAAI,CAAC,GAAG,CAAC,IAAY,CAAC,CAAC;aACzC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAA;IAC1C,CAAC;CACF;AAzKD,0CAyKC","sourcesContent":["/**\n * iCure Data Stack API Documentation\n * The iCure Data Stack Application API is the native interface to iCure. This version is obsolete, please use v2.\n *\n * OpenAPI spec version: v1\n *\n *\n * NOTE: This class is auto generated by the swagger code generator program.\n * https://github.com/swagger-api/swagger-codegen.git\n * Do not edit the class manually.\n */\nimport { XHR } from './XHR'\nimport { Appointment } from '../model/Appointment'\nimport { AppointmentImport } from '../model/AppointmentImport'\nimport { EmailOrSmsMessage } from '../model/EmailOrSmsMessage'\nimport { MikronoAppointmentTypeRest } from '../model/MikronoAppointmentTypeRest'\nimport { MikronoCredentials } from '../model/MikronoCredentials'\nimport { Unit } from '../model/Unit'\nimport { User } from '../model/User'\nimport { AuthenticationProvider, NoAuthenticationProvider } from '../../icc-x-api/auth/AuthenticationProvider'\n\nexport class IccBemikronoApi {\n host: string\n headers: Array<XHR.Header>\n authenticationProvider: AuthenticationProvider\n fetchImpl?: (input: RequestInfo, init?: RequestInit) => Promise<Response>\n\n constructor(\n host: string,\n headers: any,\n authenticationProvider?: AuthenticationProvider,\n fetchImpl?: (input: RequestInfo, init?: RequestInit) => Promise<Response>\n ) {\n this.host = host\n this.headers = Object.keys(headers).map((k) => new XHR.Header(k, headers[k]))\n this.authenticationProvider = !!authenticationProvider ? authenticationProvider : new NoAuthenticationProvider()\n this.fetchImpl = fetchImpl\n }\n\n setHeaders(h: Array<XHR.Header>) {\n this.headers = h\n }\n\n handleError(e: XHR.XHRError): never {\n throw e\n }\n\n /**\n *\n * @summary Get appointments for patient\n * @param calendarDate\n */\n appointmentsByDate(calendarDate: number): Promise<Array<Appointment>> {\n let _body = null\n\n const _url = this.host + `/be_mikrono/appointments/byDate/${encodeURIComponent(String(calendarDate))}` + '?ts=' + new Date().getTime()\n let headers = this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => new Appointment(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Get appointments for patient\n * @param patientId\n * @param from\n * @param to\n */\n appointmentsByPatient(patientId: string, from?: number, to?: number): Promise<Array<Appointment>> {\n let _body = null\n\n const _url =\n this.host +\n `/be_mikrono/appointments/byPatient/${encodeURIComponent(String(patientId))}` +\n '?ts=' +\n new Date().getTime() +\n (from ? '&from=' + encodeURIComponent(String(from)) : '') +\n (to ? '&to=' + encodeURIComponent(String(to)) : '')\n let headers = this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => new Appointment(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @param body\n */\n createAppointmentTypes(body?: Array<MikronoAppointmentTypeRest>): Promise<Array<MikronoAppointmentTypeRest>> {\n let _body = null\n _body = body\n\n const _url = this.host + `/be_mikrono/appointmentTypes` + '?ts=' + new Date().getTime()\n let headers = this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => new MikronoAppointmentTypeRest(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Create appointments for owner\n * @param body\n */\n createAppointments(body?: Array<AppointmentImport>): Promise<Array<string>> {\n let _body = null\n _body = body\n\n const _url = this.host + `/be_mikrono/appointments` + '?ts=' + new Date().getTime()\n let headers = this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => JSON.parse(JSON.stringify(it))))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Notify of an appointment change\n * @param appointmentId\n * @param action\n */\n notify(appointmentId: string, action: string): Promise<any | Boolean> {\n let _body = null\n\n const _url =\n this.host +\n `/be_mikrono/notify/${encodeURIComponent(String(appointmentId))}/${encodeURIComponent(String(action))}` +\n '?ts=' +\n new Date().getTime()\n let headers = this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => true)\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Set credentials for provided user\n * @param body\n * @param userId\n */\n register(userId: string, body?: MikronoCredentials): Promise<User> {\n let _body = null\n _body = body\n\n const _url = this.host + `/be_mikrono/user/${encodeURIComponent(String(userId))}/register` + '?ts=' + new Date().getTime()\n let headers = this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new User(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Send message using mikrono from logged user\n * @param body\n */\n sendMessage(body?: EmailOrSmsMessage): Promise<Unit> {\n let _body = null\n _body = body\n\n const _url = this.host + `/be_mikrono/sendMessage` + '?ts=' + new Date().getTime()\n let headers = this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new Unit(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Set credentials for provided user\n * @param body\n * @param userId\n */\n setUserCredentials(userId: string, body?: MikronoCredentials): Promise<User> {\n let _body = null\n _body = body\n\n const _url = this.host + `/be_mikrono/user/${encodeURIComponent(String(userId))}/credentials` + '?ts=' + new Date().getTime()\n let headers = this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new User(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n}\n"]}
|