generio-sdk 1.0.65 → 1.0.67
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/index.cjs +1 -1
- package/dist/index.d.cts +66 -81
- package/dist/index.d.ts +66 -81
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let c=require(`uuid`);c=s(c);let l=function(e){return e[e.
|
|
1
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let c=require(`uuid`);c=s(c);let l=function(e){return e[e.NewLine=0]=`NewLine`,e[e.Text=1]=`Text`,e[e.BoldText=2]=`BoldText`,e[e.CheckBox=3]=`CheckBox`,e[e.DropDownList=4]=`DropDownList`,e[e.InputText=5]=`InputText`,e[e.ConditionAndOr=6]=`ConditionAndOr`,e[e.Function=7]=`Function`,e[e.Condition=8]=`Condition`,e[e.Button=9]=`Button`,e[e.Append=10]=`Append`,e[e.DigitBox=11]=`DigitBox`,e[e.Merge=12]=`Merge`,e[e.Listing=13]=`Listing`,e[e.Bilateral=14]=`Bilateral`,e[e.Matrix=15]=`Matrix`,e[e.RememberedText=17]=`RememberedText`,e[e.InputTable=18]=`InputTable`,e[e.AppendDiagnose=19]=`AppendDiagnose`,e[e.MoveByExtParams=20]=`MoveByExtParams`,e}({});var u=class{constructor(){}ConvertExaminationDataToGeneratorRows(e){let t=[],n=0,r={subRows:[]},i=[],a=[];do{do{do{if(e[n]?.formType==l.NewLine)break;if(e[n])switch(e[n].formType){case l.DropDownList:{let t=this.CreateColumnFromExaminationData(e[n]);t.elementIndex=n;let r=[],i=1;do{let a=this.CreateColumnFromExaminationData(e[n]);a.elementIndex=n;let o=e[n]?.formValue?.trim();i===1&&o&&!o.startsWith(`-`)&&!o.endsWith(`-`)&&(t.preselected=!0),r.push(a),n++,i++}while(e[n]?.formType==l.DropDownList&&n<e.length);t.elementSelectOptions=r,a.push(t),n--;break}case l.Text:case l.Append:if(e[n]?.formValue){let t=this.CreateColumnFromExaminationData(e[n]);t.elementIndex=n,a.push(t)}break;case l.InputText:{let t=this.CreateColumnFromExaminationData(e[n]);t.elementIndex=n,t.isDistance=this.IsDistanceDefinition(e[n+1]?.formValue??``),a.push(t);break}case l.BoldText:case l.CheckBox:case l.Button:case l.DigitBox:case l.RememberedText:case l.InputTable:case l.MoveByExtParams:{let t=this.CreateColumnFromExaminationData(e[n]);t.elementIndex=n,a.push(t);break}default:break}n++}while(n<e.length);if(a.length>0){let e={columns:a};i.push(e)}if(a=[],!r.showHideElementId||!e[n]?.formValue||r.showHideElementId!=e[n]?.formValue)break;n++}while(n<e.length);i.length>0&&(r.subRows=i,t.push(r)),i=[],r={},e[n]?.formType==l.NewLine&&e[n]?.formValue?r.showHideElementId=e[n].formValue??``:r.showHideElementId=``,e[n]?.formType==l.NewLine&&e[n]?.conclusion&&e[n]?.conclusion==`hr`?r.hrBeforeRow=!0:r.hrBeforeRow=!1,n++}while(n<e.length);return t}CreateColumn(e,t,n,r,i,a,o){return{formTypeId:e,formValue:t,finding:n,conclusion:r,guid:i??(0,c.v4)(),radLexId:a,extParam:o}}CreateColumnFromExaminationData(e){return this.CreateColumn(e.formType,e.formValue,e.finding,e.conclusion,e.guid,e.radLexId,e.extParam)}IsDistanceDefinition(e){return e?e.includes(`mm`)||e.trim()===`x`:!1}};const d=`https://gener.io`,f=`generio-is-logged-in`,p=`generio-logged-in-email`;async function m(e){let t=await fetch(d+`/api/cookiesAuth/login`,{method:`POST`,credentials:`include`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(t.ok){let e=t.headers.get(`set-cookie`);return{isSuccess:!0,cookie:e?e.split(`;`)[0]:void 0}}return{isSuccess:!1}}async function h(){let e=await fetch(d+`/api/cookiesAuth/logout`,{method:`POST`,credentials:`include`,headers:{"Content-Type":`application/json`}});return e.ok||e.status===401||e.status===403?{isSuccess:!0}:{isSuccess:!1}}async function g(e){d+``;let t=await fetch(`https://gener.io/api/generioApp/recognizeExaminationCookiesAuth`,{method:`POST`,credentials:`include`,body:JSON.stringify(e),headers:{"Content-Type":`application/json`}});return t.ok?t.json():{isSuccess:!1}}async function _(e,t){let n=await fetch(d+`/api/GenerioApp/LoadFormData`,{method:`POST`,credentials:`include`,headers:{"Content-Type":`application/json`},body:JSON.stringify({examinationId:e,studyInstanceUId:t})});return n.ok?n.json():Promise.reject(Error(`Network issue`))}async function v(e){d+``;let t=await fetch(`https://gener.io/api/datasetsCookiesAuth/getExtParamValueByStudyInstanceUId`,{method:`POST`,credentials:`include`,body:JSON.stringify(e),headers:{"Content-Type":`application/json`}});return t.ok?t.json():{}}async function y(e,t){let n=await fetch(d+`/api/annotationPlacements/getAnnotationPlacements`,{method:`POST`,credentials:`include`,headers:E(t),body:JSON.stringify(e)});return n.ok?n.json():{isSuccess:!1,errorMessage:n.statusText,annotationPlacements:[]}}async function b(e){d+``;let t=await fetch(`https://gener.io/api/generioApp/setExtParamsCookiesAuth`,{method:`POST`,credentials:`include`,body:JSON.stringify(e),headers:{"Content-Type":`application/json`}});return t.ok?t.json():{isSuccess:!1,errorMessage:`Network issue`}}function x(e,t){e.postMessage({action:`setExtParams`,model:t},{targetOrigin:d})}async function S(e){d+``;let t=await fetch(`https://gener.io/api/generioApp/sendMeasurementsCookiesAuth`,{method:`POST`,credentials:`include`,body:JSON.stringify(e),headers:{"Content-Type":`application/json`}});return t.ok?t.json():{isSuccess:!1,errorMessage:`Network issue`}}async function C(e){d+``;let t=await fetch(`https://gener.io/api/generioApp/getExaminationMessageCookiesAuth`,{method:`POST`,credentials:`include`,body:JSON.stringify(e),headers:{"Content-Type":`application/json`}});return t.ok?t.json():{isSuccess:!1,errorMessage:`Network issue`}}function w(e){window.addEventListener(`message`,t=>{if(d==t.origin&&(console.info(`PostMessageListener: Received message from origin: ${t.origin}`,t.data),t.data.action==`generioReady`)){e&&e(t.data.model,t);return}},!1)}function T(e,t,n,r){let i=`${d}/generator/recognizeExamination?studyInstanceUId=${e}&modality=${t}`;return n&&(i+=`&studyDescription=${n}`),r&&(i+=`&bodyPartExamined=${r}`),i}function E(e){let t={"Content-Type":`application/json`};return e&&(t.Cookie=e),t}exports.ExaminationDataHelpers=u,exports.FormTypeEnum=l,exports.GENERIO_IS_LOGGED_IN=`generio-is-logged-in`,exports.GENERIO_LOGGED_IN_EMAIL=`generio-logged-in-email`,exports.GENERIO_ORIGIN=d,exports.getAnnotationPlacements=y,exports.getExaminationMessage=C,exports.getExtParamValueByStudyInstanceUId=v,exports.getGenerioRecognizeExaminationUrl=T,exports.loadFormData=_,exports.login=m,exports.logout=h,exports.recognizeExamination=g,exports.sendMeasurements=S,exports.setExtParams=b,exports.setExtParamsPostMessage=x,exports.setupPostMessageListeners=w;
|
package/dist/index.d.cts
CHANGED
|
@@ -95,6 +95,33 @@ interface GenerioReadyOutputModel {
|
|
|
95
95
|
studyInstanceUId: string;
|
|
96
96
|
}
|
|
97
97
|
//#endregion
|
|
98
|
+
//#region src/models/GetExaminationMessageInputModel.d.ts
|
|
99
|
+
interface GetExaminationMessageInputModel {
|
|
100
|
+
studyInstanceUId: string;
|
|
101
|
+
}
|
|
102
|
+
//#endregion
|
|
103
|
+
//#region src/models/GetAnnotationPlacementsInputModel.d.ts
|
|
104
|
+
interface GetAnnotationPlacementsInputModel {
|
|
105
|
+
examinationId: number;
|
|
106
|
+
}
|
|
107
|
+
//#endregion
|
|
108
|
+
//#region src/models/GetAnnotationPlacementsOutputModel.d.ts
|
|
109
|
+
interface GetAnnotationPlacementsOutputModel {
|
|
110
|
+
isSuccess: boolean;
|
|
111
|
+
errorMessage?: string;
|
|
112
|
+
annotationPlacements: AnnotationPlacement[];
|
|
113
|
+
}
|
|
114
|
+
interface AnnotationPlacement {
|
|
115
|
+
examinationId: number;
|
|
116
|
+
laterality: string;
|
|
117
|
+
plane: string;
|
|
118
|
+
coordsType: string;
|
|
119
|
+
coordsValue: string;
|
|
120
|
+
imagesDirectNumbers: string;
|
|
121
|
+
imagesRelativeNumbers: string;
|
|
122
|
+
guids: string;
|
|
123
|
+
}
|
|
124
|
+
//#endregion
|
|
98
125
|
//#region src/models/FormTypeEnum.d.ts
|
|
99
126
|
declare enum FormTypeEnum {
|
|
100
127
|
NewLine = 0,
|
|
@@ -132,86 +159,9 @@ interface OriginDataItem {
|
|
|
132
159
|
extParam?: string;
|
|
133
160
|
}
|
|
134
161
|
//#endregion
|
|
135
|
-
//#region src/models/
|
|
136
|
-
interface
|
|
137
|
-
/**
|
|
138
|
-
* ExaminationId
|
|
139
|
-
*/
|
|
140
|
-
id: number;
|
|
141
|
-
sortConclusion: string;
|
|
142
|
-
normalConclusion: string;
|
|
143
|
-
examinationElementSectionName: string;
|
|
144
|
-
examinationElementName: string;
|
|
145
|
-
languageCode: string;
|
|
146
|
-
loggedUserEmail: string;
|
|
147
|
-
loggedUserId: number;
|
|
148
|
-
loggedUserSawWholeTour: boolean;
|
|
149
|
-
examinationElementCreatedByUserEmail: string;
|
|
150
|
-
examinationElementCreatedByUserName: string;
|
|
151
|
-
bottomBanner: string;
|
|
152
|
-
isMachineTranslated: boolean;
|
|
153
|
-
roundDecimalsToIntegers: boolean;
|
|
154
|
-
addSpaceBeforeUnit: boolean;
|
|
155
|
-
isEnabledImagesAndExport: boolean;
|
|
156
|
-
isHiddenOtherActions: boolean;
|
|
157
|
-
copyResultCount: number;
|
|
158
|
-
copyResultLimit: number;
|
|
159
|
-
isExceededLimit: boolean;
|
|
160
|
-
exceededLimitText: string;
|
|
161
|
-
}
|
|
162
|
-
//#endregion
|
|
163
|
-
//#region src/models/OriginDetail.d.ts
|
|
164
|
-
interface OriginDetail {
|
|
165
|
-
element: OriginElementDetail;
|
|
162
|
+
//#region src/models/LoadFormDataOutputModel.d.ts
|
|
163
|
+
interface LoadFormDataOutputModel {
|
|
166
164
|
data: OriginDataItem[];
|
|
167
|
-
cultureShort: string;
|
|
168
|
-
}
|
|
169
|
-
//#endregion
|
|
170
|
-
//#region src/models/GetExaminationMessageInputModel.d.ts
|
|
171
|
-
interface GetExaminationMessageInputModel {
|
|
172
|
-
studyInstanceUId: string;
|
|
173
|
-
}
|
|
174
|
-
//#endregion
|
|
175
|
-
//#region src/models/GetAnnotationPlacementsInputModel.d.ts
|
|
176
|
-
interface GetAnnotationPlacementsInputModel {
|
|
177
|
-
examinationId: number;
|
|
178
|
-
}
|
|
179
|
-
//#endregion
|
|
180
|
-
//#region src/models/GetAnnotationPlacementsOutputModel.d.ts
|
|
181
|
-
interface GetAnnotationPlacementsOutputModel {
|
|
182
|
-
isSuccess: boolean;
|
|
183
|
-
errorMessage?: string;
|
|
184
|
-
annotationPlacements: AnnotationPlacement[];
|
|
185
|
-
}
|
|
186
|
-
interface AnnotationPlacement {
|
|
187
|
-
examinationId: number;
|
|
188
|
-
siteFromDicom: SiteFromDicomEnum;
|
|
189
|
-
planeFromDicom: PlaneFromDicomEnum;
|
|
190
|
-
positioningNoAi: PositioningNoAiEnum;
|
|
191
|
-
imagesNoAi: string;
|
|
192
|
-
coordinatesAi: string;
|
|
193
|
-
imagesAi: string;
|
|
194
|
-
guids: string;
|
|
195
|
-
}
|
|
196
|
-
declare enum SiteFromDicomEnum {
|
|
197
|
-
None = 0,
|
|
198
|
-
Left = 1,
|
|
199
|
-
Right = 2,
|
|
200
|
-
Bottom = 3,
|
|
201
|
-
Top = 4,
|
|
202
|
-
}
|
|
203
|
-
declare enum PlaneFromDicomEnum {
|
|
204
|
-
None = 0,
|
|
205
|
-
Coronal = 1,
|
|
206
|
-
Sagittal = 2,
|
|
207
|
-
Transverse = 3,
|
|
208
|
-
}
|
|
209
|
-
declare enum PositioningNoAiEnum {
|
|
210
|
-
None = 0,
|
|
211
|
-
Left = 1,
|
|
212
|
-
Right = 2,
|
|
213
|
-
Bottom = 3,
|
|
214
|
-
Top = 4,
|
|
215
165
|
}
|
|
216
166
|
//#endregion
|
|
217
167
|
//#region src/models/Column.d.ts
|
|
@@ -249,6 +199,41 @@ interface ElementRow {
|
|
|
249
199
|
subRows: Array<ElementSubRow>;
|
|
250
200
|
}
|
|
251
201
|
//#endregion
|
|
202
|
+
//#region src/models/OriginElementDetail.d.ts
|
|
203
|
+
interface OriginElementDetail {
|
|
204
|
+
/**
|
|
205
|
+
* ExaminationId
|
|
206
|
+
*/
|
|
207
|
+
id: number;
|
|
208
|
+
sortConclusion: string;
|
|
209
|
+
normalConclusion: string;
|
|
210
|
+
examinationElementSectionName: string;
|
|
211
|
+
examinationElementName: string;
|
|
212
|
+
languageCode: string;
|
|
213
|
+
loggedUserEmail: string;
|
|
214
|
+
loggedUserId: number;
|
|
215
|
+
loggedUserSawWholeTour: boolean;
|
|
216
|
+
examinationElementCreatedByUserEmail: string;
|
|
217
|
+
examinationElementCreatedByUserName: string;
|
|
218
|
+
bottomBanner: string;
|
|
219
|
+
isMachineTranslated: boolean;
|
|
220
|
+
roundDecimalsToIntegers: boolean;
|
|
221
|
+
addSpaceBeforeUnit: boolean;
|
|
222
|
+
isEnabledImagesAndExport: boolean;
|
|
223
|
+
isHiddenOtherActions: boolean;
|
|
224
|
+
copyResultCount: number;
|
|
225
|
+
copyResultLimit: number;
|
|
226
|
+
isExceededLimit: boolean;
|
|
227
|
+
exceededLimitText: string;
|
|
228
|
+
}
|
|
229
|
+
//#endregion
|
|
230
|
+
//#region src/models/OriginDetail.d.ts
|
|
231
|
+
interface OriginDetail {
|
|
232
|
+
element: OriginElementDetail;
|
|
233
|
+
data: OriginDataItem[];
|
|
234
|
+
cultureShort: string;
|
|
235
|
+
}
|
|
236
|
+
//#endregion
|
|
252
237
|
//#region src/models/AppendDiagnoseFormHandlebarsModel.d.ts
|
|
253
238
|
interface AppendDiagnoseFormHandlebarsModel {
|
|
254
239
|
index: number;
|
|
@@ -283,7 +268,7 @@ declare function login(model: LoginInputModel): Promise<LoginOutputModel & {
|
|
|
283
268
|
}>;
|
|
284
269
|
declare function logout(): Promise<LogoutOutputModel>;
|
|
285
270
|
declare function recognizeExamination(model: RecognizeExaminationInputModel): Promise<RecognizeExaminationOutputModel>;
|
|
286
|
-
declare function
|
|
271
|
+
declare function loadFormData(examinationId: number, studyInstanceUId: string): Promise<LoadFormDataOutputModel>;
|
|
287
272
|
declare function getExtParamValueByStudyInstanceUId(model: GetExtParamValueByStudyInstanceUIdInputModel): Promise<GetExtParamValueByStudyInstanceUIdOutputModel>;
|
|
288
273
|
declare function getAnnotationPlacements(model: GetAnnotationPlacementsInputModel, cookie?: string): Promise<GetAnnotationPlacementsOutputModel>;
|
|
289
274
|
declare function setExtParams(model: SetExtParamsInputModel): Promise<SetExtParamsOutputModel>;
|
|
@@ -293,4 +278,4 @@ declare function getExaminationMessage(model: GetExaminationMessageInputModel):
|
|
|
293
278
|
declare function setupPostMessageListeners(generioReadyHandler?: (model: GenerioReadyOutputModel, event: MessageEvent) => void): void;
|
|
294
279
|
declare function getGenerioRecognizeExaminationUrl(studyInstanceUId: string, modality: string, studyDescription?: string, bodyPartExamined?: string): string;
|
|
295
280
|
//#endregion
|
|
296
|
-
export { AnnotationPlacement, type AppendDiagnoseFormHandlebarsModel, type Column, type ElementColumn, type ElementRow, type ElementSubRow, ExaminationDataHelpers, type FindingGeneratorFormHandlebarsModel, FormTypeEnum, GENERIO_IS_LOGGED_IN, GENERIO_LOGGED_IN_EMAIL, GENERIO_ORIGIN, GenerioReadyOutputModel, GetAnnotationPlacementsInputModel, GetAnnotationPlacementsOutputModel, GetExaminationMessageInputModel, GetExaminationMessageOutputModel, GetExtParamValueByStudyInstanceUIdInputModel, GetExtParamValueByStudyInstanceUIdOutputModel, KeyValueModel, LoginInputModel, LoginOutputModel, LogoutOutputModel, MeasurementModel, type OriginDataItem, type OriginDetail, type OriginElementDetail,
|
|
281
|
+
export { AnnotationPlacement, type AppendDiagnoseFormHandlebarsModel, type Column, type ElementColumn, type ElementRow, type ElementSubRow, ExaminationDataHelpers, type FindingGeneratorFormHandlebarsModel, FormTypeEnum, GENERIO_IS_LOGGED_IN, GENERIO_LOGGED_IN_EMAIL, GENERIO_ORIGIN, GenerioReadyOutputModel, GetAnnotationPlacementsInputModel, GetAnnotationPlacementsOutputModel, GetExaminationMessageInputModel, GetExaminationMessageOutputModel, GetExtParamValueByStudyInstanceUIdInputModel, GetExtParamValueByStudyInstanceUIdOutputModel, KeyValueModel, LoadFormDataOutputModel, LoginInputModel, LoginOutputModel, LogoutOutputModel, MeasurementModel, type OriginDataItem, type OriginDetail, type OriginElementDetail, RecognizeExaminationInputModel, RecognizeExaminationOutputModel, SendMeasurementsInputModel, SendMeasurementsOutputModel, SetExtParamsInputModel, SetExtParamsOutputModel, getAnnotationPlacements, getExaminationMessage, getExtParamValueByStudyInstanceUId, getGenerioRecognizeExaminationUrl, loadFormData, login, logout, recognizeExamination, sendMeasurements, setExtParams, setExtParamsPostMessage, setupPostMessageListeners };
|
package/dist/index.d.ts
CHANGED
|
@@ -95,6 +95,33 @@ interface GenerioReadyOutputModel {
|
|
|
95
95
|
studyInstanceUId: string;
|
|
96
96
|
}
|
|
97
97
|
//#endregion
|
|
98
|
+
//#region src/models/GetExaminationMessageInputModel.d.ts
|
|
99
|
+
interface GetExaminationMessageInputModel {
|
|
100
|
+
studyInstanceUId: string;
|
|
101
|
+
}
|
|
102
|
+
//#endregion
|
|
103
|
+
//#region src/models/GetAnnotationPlacementsInputModel.d.ts
|
|
104
|
+
interface GetAnnotationPlacementsInputModel {
|
|
105
|
+
examinationId: number;
|
|
106
|
+
}
|
|
107
|
+
//#endregion
|
|
108
|
+
//#region src/models/GetAnnotationPlacementsOutputModel.d.ts
|
|
109
|
+
interface GetAnnotationPlacementsOutputModel {
|
|
110
|
+
isSuccess: boolean;
|
|
111
|
+
errorMessage?: string;
|
|
112
|
+
annotationPlacements: AnnotationPlacement[];
|
|
113
|
+
}
|
|
114
|
+
interface AnnotationPlacement {
|
|
115
|
+
examinationId: number;
|
|
116
|
+
laterality: string;
|
|
117
|
+
plane: string;
|
|
118
|
+
coordsType: string;
|
|
119
|
+
coordsValue: string;
|
|
120
|
+
imagesDirectNumbers: string;
|
|
121
|
+
imagesRelativeNumbers: string;
|
|
122
|
+
guids: string;
|
|
123
|
+
}
|
|
124
|
+
//#endregion
|
|
98
125
|
//#region src/models/FormTypeEnum.d.ts
|
|
99
126
|
declare enum FormTypeEnum {
|
|
100
127
|
NewLine = 0,
|
|
@@ -132,86 +159,9 @@ interface OriginDataItem {
|
|
|
132
159
|
extParam?: string;
|
|
133
160
|
}
|
|
134
161
|
//#endregion
|
|
135
|
-
//#region src/models/
|
|
136
|
-
interface
|
|
137
|
-
/**
|
|
138
|
-
* ExaminationId
|
|
139
|
-
*/
|
|
140
|
-
id: number;
|
|
141
|
-
sortConclusion: string;
|
|
142
|
-
normalConclusion: string;
|
|
143
|
-
examinationElementSectionName: string;
|
|
144
|
-
examinationElementName: string;
|
|
145
|
-
languageCode: string;
|
|
146
|
-
loggedUserEmail: string;
|
|
147
|
-
loggedUserId: number;
|
|
148
|
-
loggedUserSawWholeTour: boolean;
|
|
149
|
-
examinationElementCreatedByUserEmail: string;
|
|
150
|
-
examinationElementCreatedByUserName: string;
|
|
151
|
-
bottomBanner: string;
|
|
152
|
-
isMachineTranslated: boolean;
|
|
153
|
-
roundDecimalsToIntegers: boolean;
|
|
154
|
-
addSpaceBeforeUnit: boolean;
|
|
155
|
-
isEnabledImagesAndExport: boolean;
|
|
156
|
-
isHiddenOtherActions: boolean;
|
|
157
|
-
copyResultCount: number;
|
|
158
|
-
copyResultLimit: number;
|
|
159
|
-
isExceededLimit: boolean;
|
|
160
|
-
exceededLimitText: string;
|
|
161
|
-
}
|
|
162
|
-
//#endregion
|
|
163
|
-
//#region src/models/OriginDetail.d.ts
|
|
164
|
-
interface OriginDetail {
|
|
165
|
-
element: OriginElementDetail;
|
|
162
|
+
//#region src/models/LoadFormDataOutputModel.d.ts
|
|
163
|
+
interface LoadFormDataOutputModel {
|
|
166
164
|
data: OriginDataItem[];
|
|
167
|
-
cultureShort: string;
|
|
168
|
-
}
|
|
169
|
-
//#endregion
|
|
170
|
-
//#region src/models/GetExaminationMessageInputModel.d.ts
|
|
171
|
-
interface GetExaminationMessageInputModel {
|
|
172
|
-
studyInstanceUId: string;
|
|
173
|
-
}
|
|
174
|
-
//#endregion
|
|
175
|
-
//#region src/models/GetAnnotationPlacementsInputModel.d.ts
|
|
176
|
-
interface GetAnnotationPlacementsInputModel {
|
|
177
|
-
examinationId: number;
|
|
178
|
-
}
|
|
179
|
-
//#endregion
|
|
180
|
-
//#region src/models/GetAnnotationPlacementsOutputModel.d.ts
|
|
181
|
-
interface GetAnnotationPlacementsOutputModel {
|
|
182
|
-
isSuccess: boolean;
|
|
183
|
-
errorMessage?: string;
|
|
184
|
-
annotationPlacements: AnnotationPlacement[];
|
|
185
|
-
}
|
|
186
|
-
interface AnnotationPlacement {
|
|
187
|
-
examinationId: number;
|
|
188
|
-
siteFromDicom: SiteFromDicomEnum;
|
|
189
|
-
planeFromDicom: PlaneFromDicomEnum;
|
|
190
|
-
positioningNoAi: PositioningNoAiEnum;
|
|
191
|
-
imagesNoAi: string;
|
|
192
|
-
coordinatesAi: string;
|
|
193
|
-
imagesAi: string;
|
|
194
|
-
guids: string;
|
|
195
|
-
}
|
|
196
|
-
declare enum SiteFromDicomEnum {
|
|
197
|
-
None = 0,
|
|
198
|
-
Left = 1,
|
|
199
|
-
Right = 2,
|
|
200
|
-
Bottom = 3,
|
|
201
|
-
Top = 4,
|
|
202
|
-
}
|
|
203
|
-
declare enum PlaneFromDicomEnum {
|
|
204
|
-
None = 0,
|
|
205
|
-
Coronal = 1,
|
|
206
|
-
Sagittal = 2,
|
|
207
|
-
Transverse = 3,
|
|
208
|
-
}
|
|
209
|
-
declare enum PositioningNoAiEnum {
|
|
210
|
-
None = 0,
|
|
211
|
-
Left = 1,
|
|
212
|
-
Right = 2,
|
|
213
|
-
Bottom = 3,
|
|
214
|
-
Top = 4,
|
|
215
165
|
}
|
|
216
166
|
//#endregion
|
|
217
167
|
//#region src/models/Column.d.ts
|
|
@@ -249,6 +199,41 @@ interface ElementRow {
|
|
|
249
199
|
subRows: Array<ElementSubRow>;
|
|
250
200
|
}
|
|
251
201
|
//#endregion
|
|
202
|
+
//#region src/models/OriginElementDetail.d.ts
|
|
203
|
+
interface OriginElementDetail {
|
|
204
|
+
/**
|
|
205
|
+
* ExaminationId
|
|
206
|
+
*/
|
|
207
|
+
id: number;
|
|
208
|
+
sortConclusion: string;
|
|
209
|
+
normalConclusion: string;
|
|
210
|
+
examinationElementSectionName: string;
|
|
211
|
+
examinationElementName: string;
|
|
212
|
+
languageCode: string;
|
|
213
|
+
loggedUserEmail: string;
|
|
214
|
+
loggedUserId: number;
|
|
215
|
+
loggedUserSawWholeTour: boolean;
|
|
216
|
+
examinationElementCreatedByUserEmail: string;
|
|
217
|
+
examinationElementCreatedByUserName: string;
|
|
218
|
+
bottomBanner: string;
|
|
219
|
+
isMachineTranslated: boolean;
|
|
220
|
+
roundDecimalsToIntegers: boolean;
|
|
221
|
+
addSpaceBeforeUnit: boolean;
|
|
222
|
+
isEnabledImagesAndExport: boolean;
|
|
223
|
+
isHiddenOtherActions: boolean;
|
|
224
|
+
copyResultCount: number;
|
|
225
|
+
copyResultLimit: number;
|
|
226
|
+
isExceededLimit: boolean;
|
|
227
|
+
exceededLimitText: string;
|
|
228
|
+
}
|
|
229
|
+
//#endregion
|
|
230
|
+
//#region src/models/OriginDetail.d.ts
|
|
231
|
+
interface OriginDetail {
|
|
232
|
+
element: OriginElementDetail;
|
|
233
|
+
data: OriginDataItem[];
|
|
234
|
+
cultureShort: string;
|
|
235
|
+
}
|
|
236
|
+
//#endregion
|
|
252
237
|
//#region src/models/AppendDiagnoseFormHandlebarsModel.d.ts
|
|
253
238
|
interface AppendDiagnoseFormHandlebarsModel {
|
|
254
239
|
index: number;
|
|
@@ -283,7 +268,7 @@ declare function login(model: LoginInputModel): Promise<LoginOutputModel & {
|
|
|
283
268
|
}>;
|
|
284
269
|
declare function logout(): Promise<LogoutOutputModel>;
|
|
285
270
|
declare function recognizeExamination(model: RecognizeExaminationInputModel): Promise<RecognizeExaminationOutputModel>;
|
|
286
|
-
declare function
|
|
271
|
+
declare function loadFormData(examinationId: number, studyInstanceUId: string): Promise<LoadFormDataOutputModel>;
|
|
287
272
|
declare function getExtParamValueByStudyInstanceUId(model: GetExtParamValueByStudyInstanceUIdInputModel): Promise<GetExtParamValueByStudyInstanceUIdOutputModel>;
|
|
288
273
|
declare function getAnnotationPlacements(model: GetAnnotationPlacementsInputModel, cookie?: string): Promise<GetAnnotationPlacementsOutputModel>;
|
|
289
274
|
declare function setExtParams(model: SetExtParamsInputModel): Promise<SetExtParamsOutputModel>;
|
|
@@ -293,4 +278,4 @@ declare function getExaminationMessage(model: GetExaminationMessageInputModel):
|
|
|
293
278
|
declare function setupPostMessageListeners(generioReadyHandler?: (model: GenerioReadyOutputModel, event: MessageEvent) => void): void;
|
|
294
279
|
declare function getGenerioRecognizeExaminationUrl(studyInstanceUId: string, modality: string, studyDescription?: string, bodyPartExamined?: string): string;
|
|
295
280
|
//#endregion
|
|
296
|
-
export { AnnotationPlacement, type AppendDiagnoseFormHandlebarsModel, type Column, type ElementColumn, type ElementRow, type ElementSubRow, ExaminationDataHelpers, type FindingGeneratorFormHandlebarsModel, FormTypeEnum, GENERIO_IS_LOGGED_IN, GENERIO_LOGGED_IN_EMAIL, GENERIO_ORIGIN, GenerioReadyOutputModel, GetAnnotationPlacementsInputModel, GetAnnotationPlacementsOutputModel, GetExaminationMessageInputModel, GetExaminationMessageOutputModel, GetExtParamValueByStudyInstanceUIdInputModel, GetExtParamValueByStudyInstanceUIdOutputModel, KeyValueModel, LoginInputModel, LoginOutputModel, LogoutOutputModel, MeasurementModel, type OriginDataItem, type OriginDetail, type OriginElementDetail,
|
|
281
|
+
export { AnnotationPlacement, type AppendDiagnoseFormHandlebarsModel, type Column, type ElementColumn, type ElementRow, type ElementSubRow, ExaminationDataHelpers, type FindingGeneratorFormHandlebarsModel, FormTypeEnum, GENERIO_IS_LOGGED_IN, GENERIO_LOGGED_IN_EMAIL, GENERIO_ORIGIN, GenerioReadyOutputModel, GetAnnotationPlacementsInputModel, GetAnnotationPlacementsOutputModel, GetExaminationMessageInputModel, GetExaminationMessageOutputModel, GetExtParamValueByStudyInstanceUIdInputModel, GetExtParamValueByStudyInstanceUIdOutputModel, KeyValueModel, LoadFormDataOutputModel, LoginInputModel, LoginOutputModel, LogoutOutputModel, MeasurementModel, type OriginDataItem, type OriginDetail, type OriginElementDetail, RecognizeExaminationInputModel, RecognizeExaminationOutputModel, SendMeasurementsInputModel, SendMeasurementsOutputModel, SetExtParamsInputModel, SetExtParamsOutputModel, getAnnotationPlacements, getExaminationMessage, getExtParamValueByStudyInstanceUId, getGenerioRecognizeExaminationUrl, loadFormData, login, logout, recognizeExamination, sendMeasurements, setExtParams, setExtParamsPostMessage, setupPostMessageListeners };
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{v4 as e}from"uuid";let t=function(e){return e[e.
|
|
1
|
+
import{v4 as e}from"uuid";let t=function(e){return e[e.NewLine=0]=`NewLine`,e[e.Text=1]=`Text`,e[e.BoldText=2]=`BoldText`,e[e.CheckBox=3]=`CheckBox`,e[e.DropDownList=4]=`DropDownList`,e[e.InputText=5]=`InputText`,e[e.ConditionAndOr=6]=`ConditionAndOr`,e[e.Function=7]=`Function`,e[e.Condition=8]=`Condition`,e[e.Button=9]=`Button`,e[e.Append=10]=`Append`,e[e.DigitBox=11]=`DigitBox`,e[e.Merge=12]=`Merge`,e[e.Listing=13]=`Listing`,e[e.Bilateral=14]=`Bilateral`,e[e.Matrix=15]=`Matrix`,e[e.RememberedText=17]=`RememberedText`,e[e.InputTable=18]=`InputTable`,e[e.AppendDiagnose=19]=`AppendDiagnose`,e[e.MoveByExtParams=20]=`MoveByExtParams`,e}({});var n=class{constructor(){}ConvertExaminationDataToGeneratorRows(e){let n=[],r=0,i={subRows:[]},a=[],o=[];do{do{do{if(e[r]?.formType==t.NewLine)break;if(e[r])switch(e[r].formType){case t.DropDownList:{let n=this.CreateColumnFromExaminationData(e[r]);n.elementIndex=r;let i=[],a=1;do{let t=this.CreateColumnFromExaminationData(e[r]);t.elementIndex=r;let o=e[r]?.formValue?.trim();a===1&&o&&!o.startsWith(`-`)&&!o.endsWith(`-`)&&(n.preselected=!0),i.push(t),r++,a++}while(e[r]?.formType==t.DropDownList&&r<e.length);n.elementSelectOptions=i,o.push(n),r--;break}case t.Text:case t.Append:if(e[r]?.formValue){let t=this.CreateColumnFromExaminationData(e[r]);t.elementIndex=r,o.push(t)}break;case t.InputText:{let t=this.CreateColumnFromExaminationData(e[r]);t.elementIndex=r,t.isDistance=this.IsDistanceDefinition(e[r+1]?.formValue??``),o.push(t);break}case t.BoldText:case t.CheckBox:case t.Button:case t.DigitBox:case t.RememberedText:case t.InputTable:case t.MoveByExtParams:{let t=this.CreateColumnFromExaminationData(e[r]);t.elementIndex=r,o.push(t);break}default:break}r++}while(r<e.length);if(o.length>0){let e={columns:o};a.push(e)}if(o=[],!i.showHideElementId||!e[r]?.formValue||i.showHideElementId!=e[r]?.formValue)break;r++}while(r<e.length);a.length>0&&(i.subRows=a,n.push(i)),a=[],i={},e[r]?.formType==t.NewLine&&e[r]?.formValue?i.showHideElementId=e[r].formValue??``:i.showHideElementId=``,e[r]?.formType==t.NewLine&&e[r]?.conclusion&&e[r]?.conclusion==`hr`?i.hrBeforeRow=!0:i.hrBeforeRow=!1,r++}while(r<e.length);return n}CreateColumn(t,n,r,i,a,o,s){return{formTypeId:t,formValue:n,finding:r,conclusion:i,guid:a??e(),radLexId:o,extParam:s}}CreateColumnFromExaminationData(e){return this.CreateColumn(e.formType,e.formValue,e.finding,e.conclusion,e.guid,e.radLexId,e.extParam)}IsDistanceDefinition(e){return e?e.includes(`mm`)||e.trim()===`x`:!1}};const r=`https://gener.io`,i=`generio-is-logged-in`,a=`generio-logged-in-email`;async function o(e){let t=await fetch(r+`/api/cookiesAuth/login`,{method:`POST`,credentials:`include`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(t.ok){let e=t.headers.get(`set-cookie`);return{isSuccess:!0,cookie:e?e.split(`;`)[0]:void 0}}return{isSuccess:!1}}async function s(){let e=await fetch(r+`/api/cookiesAuth/logout`,{method:`POST`,credentials:`include`,headers:{"Content-Type":`application/json`}});return e.ok||e.status===401||e.status===403?{isSuccess:!0}:{isSuccess:!1}}async function c(e){r+``;let t=await fetch(`https://gener.io/api/generioApp/recognizeExaminationCookiesAuth`,{method:`POST`,credentials:`include`,body:JSON.stringify(e),headers:{"Content-Type":`application/json`}});return t.ok?t.json():{isSuccess:!1}}async function l(e,t){let n=await fetch(r+`/api/GenerioApp/LoadFormData`,{method:`POST`,credentials:`include`,headers:{"Content-Type":`application/json`},body:JSON.stringify({examinationId:e,studyInstanceUId:t})});return n.ok?n.json():Promise.reject(Error(`Network issue`))}async function u(e){r+``;let t=await fetch(`https://gener.io/api/datasetsCookiesAuth/getExtParamValueByStudyInstanceUId`,{method:`POST`,credentials:`include`,body:JSON.stringify(e),headers:{"Content-Type":`application/json`}});return t.ok?t.json():{}}async function d(e,t){let n=await fetch(r+`/api/annotationPlacements/getAnnotationPlacements`,{method:`POST`,credentials:`include`,headers:v(t),body:JSON.stringify(e)});return n.ok?n.json():{isSuccess:!1,errorMessage:n.statusText,annotationPlacements:[]}}async function f(e){r+``;let t=await fetch(`https://gener.io/api/generioApp/setExtParamsCookiesAuth`,{method:`POST`,credentials:`include`,body:JSON.stringify(e),headers:{"Content-Type":`application/json`}});return t.ok?t.json():{isSuccess:!1,errorMessage:`Network issue`}}function p(e,t){e.postMessage({action:`setExtParams`,model:t},{targetOrigin:r})}async function m(e){r+``;let t=await fetch(`https://gener.io/api/generioApp/sendMeasurementsCookiesAuth`,{method:`POST`,credentials:`include`,body:JSON.stringify(e),headers:{"Content-Type":`application/json`}});return t.ok?t.json():{isSuccess:!1,errorMessage:`Network issue`}}async function h(e){r+``;let t=await fetch(`https://gener.io/api/generioApp/getExaminationMessageCookiesAuth`,{method:`POST`,credentials:`include`,body:JSON.stringify(e),headers:{"Content-Type":`application/json`}});return t.ok?t.json():{isSuccess:!1,errorMessage:`Network issue`}}function g(e){window.addEventListener(`message`,t=>{if(r==t.origin&&(console.info(`PostMessageListener: Received message from origin: ${t.origin}`,t.data),t.data.action==`generioReady`)){e&&e(t.data.model,t);return}},!1)}function _(e,t,n,i){let a=`${r}/generator/recognizeExamination?studyInstanceUId=${e}&modality=${t}`;return n&&(a+=`&studyDescription=${n}`),i&&(a+=`&bodyPartExamined=${i}`),a}function v(e){let t={"Content-Type":`application/json`};return e&&(t.Cookie=e),t}export{n as ExaminationDataHelpers,t as FormTypeEnum,i as GENERIO_IS_LOGGED_IN,a as GENERIO_LOGGED_IN_EMAIL,r as GENERIO_ORIGIN,d as getAnnotationPlacements,h as getExaminationMessage,u as getExtParamValueByStudyInstanceUId,_ as getGenerioRecognizeExaminationUrl,l as loadFormData,o as login,s as logout,c as recognizeExamination,m as sendMeasurements,f as setExtParams,p as setExtParamsPostMessage,g as setupPostMessageListeners};
|