generio-sdk 1.0.39 → 1.0.41

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.d.ts CHANGED
@@ -15,6 +15,7 @@ interface RecognizeExaminationOutputModel {
15
15
  //#endregion
16
16
  //#region src/models/SetExtParamsInputModel.d.ts
17
17
  interface SetExtParamsInputModel {
18
+ studyInstanceUId: string;
18
19
  keyValues: KeyValueModel[];
19
20
  }
20
21
  interface KeyValueModel {
@@ -25,7 +26,7 @@ interface KeyValueModel {
25
26
  //#region src/models/SetExtParamsOutputModel.d.ts
26
27
  interface SetExtParamsOutputModel {
27
28
  isSuccess: boolean;
28
- message: string;
29
+ message?: string;
29
30
  }
30
31
  //#endregion
31
32
  //#region src/models/SendMeasurementsOutputModel.d.ts
@@ -33,6 +34,7 @@ interface SendMeasurementsOutputModel {}
33
34
  //#endregion
34
35
  //#region src/models/SendMeasurementsInputModel.d.ts
35
36
  interface SendMeasurementsInputModel {
37
+ studyInstanceUId: string;
36
38
  measurements: MeasurementModel[];
37
39
  }
38
40
  interface MeasurementModel {
@@ -219,18 +221,18 @@ declare class ExaminationDataHelpers {
219
221
  }
220
222
  //#endregion
221
223
  //#region src/index.d.ts
222
- declare function SET_GENERIO_ORIGIN(newOrigin?: string): void;
224
+ declare function SET_GENERIO_ORIGIN(newOrigin: string): void;
223
225
  declare function GENERIO_ORIGIN(): string;
224
226
  declare const GENERIO_IS_LOGGED_IN = "generio-is-logged-in";
225
227
  declare const GENERIO_LOGGED_IN_EMAIL = "generio-logged-in-email";
226
228
  declare function recognizeExamination(model: RecognizeExaminationInputModel): Promise<RecognizeExaminationOutputModel>;
227
- declare function setExtParams(model: SetExtParamsInputModel, win: Window): Promise<SetExtParamsOutputModel>;
228
- declare function sendMeasurements(model: SendMeasurementsInputModel, win: Window): Promise<SendMeasurementsOutputModel>;
229
- declare function getExtParamValueByStudyInstanceUId(model: GetExtParamValueByStudyInstanceUIdInputModel, win: Window): Promise<GetExtParamValueByStudyInstanceUIdOutputModel>;
230
- declare function getExaminationMessage(win: Window): Promise<GetExaminationMessageOutputModel>;
229
+ declare function setExtParams(model: SetExtParamsInputModel): Promise<SetExtParamsOutputModel>;
230
+ declare function sendMeasurements(model: SendMeasurementsInputModel): Promise<SendMeasurementsOutputModel>;
231
+ declare function getExtParamValueByStudyInstanceUId(model: GetExtParamValueByStudyInstanceUIdInputModel): Promise<GetExtParamValueByStudyInstanceUIdOutputModel>;
232
+ declare function getExaminationMessage(): Promise<GetExaminationMessageOutputModel>;
231
233
  declare function login(model: LoginInputModel): Promise<LoginOutputModel>;
232
234
  declare function logout(): Promise<LogoutOutputModel>;
233
- declare function setupPostMessageListener(generioReadyHandler?: (payload: GenerioReadyOutputModel) => void): void;
235
+ declare function setupPostMessageListeners(generioReadyHandler?: (payload: GenerioReadyOutputModel) => void): void;
234
236
  declare function loadExamination(examinationId: number, studyInstanceUId: string): Promise<OriginDetail>;
235
237
  //#endregion
236
- export { type AppendDiagnoseFormHandlebarsModel, type Column, type ElementColumn, type ElementRow, type ElementSubRow, ExaminationDataHelpers, type FindingGeneratorFormHandlebarsModel, FormTypeEnum, GENERIO_IS_LOGGED_IN, GENERIO_LOGGED_IN_EMAIL, GENERIO_ORIGIN, GetExaminationMessageOutputModel, GetExtParamValueByStudyInstanceUIdInputModel, GetExtParamValueByStudyInstanceUIdOutputModel, KeyValueModel, LoginInputModel, LoginOutputModel, LogoutOutputModel, MeasurementModel, type OriginDataItem, type OriginDetail, type OriginElementDetail, RecognizeExaminationInputModel, RecognizeExaminationOutputModel, SET_GENERIO_ORIGIN, SendMeasurementsInputModel, SendMeasurementsOutputModel, SetExtParamsInputModel, SetExtParamsOutputModel, getExaminationMessage, getExtParamValueByStudyInstanceUId, loadExamination, login, logout, recognizeExamination, sendMeasurements, setExtParams, setupPostMessageListener };
238
+ export { type AppendDiagnoseFormHandlebarsModel, type Column, type ElementColumn, type ElementRow, type ElementSubRow, ExaminationDataHelpers, type FindingGeneratorFormHandlebarsModel, FormTypeEnum, GENERIO_IS_LOGGED_IN, GENERIO_LOGGED_IN_EMAIL, GENERIO_ORIGIN, GetExaminationMessageOutputModel, GetExtParamValueByStudyInstanceUIdInputModel, GetExtParamValueByStudyInstanceUIdOutputModel, KeyValueModel, LoginInputModel, LoginOutputModel, LogoutOutputModel, MeasurementModel, type OriginDataItem, type OriginDetail, type OriginElementDetail, RecognizeExaminationInputModel, RecognizeExaminationOutputModel, SET_GENERIO_ORIGIN, SendMeasurementsInputModel, SendMeasurementsOutputModel, SetExtParamsInputModel, SetExtParamsOutputModel, getExaminationMessage, getExtParamValueByStudyInstanceUId, loadExamination, login, logout, recognizeExamination, sendMeasurements, setExtParams, setupPostMessageListeners };
package/dist/index.js CHANGED
@@ -1 +1 @@
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(){}ConvertExaminationDataToElementRows(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}};let r=`https://gener.io`;function i(e=`https://localhost:7052`){r=e}function a(){return r}const o=`generio-is-logged-in`,s=`generio-logged-in-email`;async function c(e){let t=a()+`/api/generioApp/recognizeExaminationByUserContext`,n=await fetch(t,{method:`POST`,credentials:`include`,body:JSON.stringify(e),headers:{"Content-Type":`application/json`}});return n.ok?n.json():{isSuccess:!1}}async function l(e,t){return{}}async function u(e,t){return{}}async function d(e,t){return{}}async function f(e){return{}}async function p(e){return(await fetch(a()+`/api/cookiesAuth/login`,{method:`POST`,credentials:`include`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)})).ok?{isSuccess:!0}:{isSuccess:!1}}async function m(){let e=await fetch(a()+`/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}}function h(e){window.addEventListener(`message`,t=>{a()==t.origin&&(console.info(`PostMessageListener: Received message from origin: ${t.origin}`,t.data),t.data.action==`generioReady`&&e&&e(t.data.payload))},!1)}async function g(e,t){let n=await fetch(a()+`/api/GenerioApp/LoadExamination`,{method:`POST`,credentials:`include`,headers:{"Content-Type":`application/json`},body:JSON.stringify({examinationId:e,studyInstanceUId:t})});if(!n.ok)throw Error(`Failed to load examination data`);return await n.json()}export{n as ExaminationDataHelpers,t as FormTypeEnum,o as GENERIO_IS_LOGGED_IN,s as GENERIO_LOGGED_IN_EMAIL,a as GENERIO_ORIGIN,i as SET_GENERIO_ORIGIN,f as getExaminationMessage,d as getExtParamValueByStudyInstanceUId,g as loadExamination,p as login,m as logout,c as recognizeExamination,u as sendMeasurements,l as setExtParams,h as setupPostMessageListener};
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(){}ConvertExaminationDataToElementRows(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}};let r=`https://gener.io`;function i(e){r=e}function a(){return r}const o=`generio-is-logged-in`,s=`generio-logged-in-email`;async function c(e){let t=a()+`/api/generioApp/recognizeExaminationByUserContext`,n=await fetch(t,{method:`POST`,credentials:`include`,body:JSON.stringify(e),headers:{"Content-Type":`application/json`}});return n.ok?n.json():{isSuccess:!1}}async function l(e){let t=a()+`/api/generioApp/setExtParams`,n=await fetch(t,{method:`POST`,credentials:`include`,body:JSON.stringify(e),headers:{"Content-Type":`application/json`}});return n.ok?n.json():{isSuccess:!1}}async function u(e){let t=a()+`/api/generioApp/sendMeasurements`,n=await fetch(t,{method:`POST`,credentials:`include`,body:JSON.stringify(e),headers:{"Content-Type":`application/json`}});return n.ok?n.json():{isSuccess:!1}}async function d(e){let t=a()+`/api/generioApp/getExtParamValueByStudyInstanceUId`,n=await fetch(t,{method:`POST`,credentials:`include`,body:JSON.stringify(e),headers:{"Content-Type":`application/json`}});return n.ok?n.json():{}}async function f(){let e=a()+`/api/generioApp/getExaminationMessage`,t=await fetch(e,{method:`POST`,credentials:`include`,headers:{"Content-Type":`application/json`}});return t.ok?t.json():{}}async function p(e){return(await fetch(a()+`/api/cookiesAuth/login`,{method:`POST`,credentials:`include`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)})).ok?{isSuccess:!0}:{isSuccess:!1}}async function m(){let e=await fetch(a()+`/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}}function h(e){window.addEventListener(`message`,t=>{a()==t.origin&&(console.info(`PostMessageListener: Received message from origin: ${t.origin}`,t.data),t.data.action==`generioReady`&&e&&e(t.data.payload))},!1)}async function g(e,t){let n=await fetch(a()+`/api/GenerioApp/LoadExamination`,{method:`POST`,credentials:`include`,headers:{"Content-Type":`application/json`},body:JSON.stringify({examinationId:e,studyInstanceUId:t})});if(!n.ok)throw Error(`Failed to load examination data`);return await n.json()}export{n as ExaminationDataHelpers,t as FormTypeEnum,o as GENERIO_IS_LOGGED_IN,s as GENERIO_LOGGED_IN_EMAIL,a as GENERIO_ORIGIN,i as SET_GENERIO_ORIGIN,f as getExaminationMessage,d as getExtParamValueByStudyInstanceUId,g as loadExamination,p as login,m as logout,c as recognizeExamination,u as sendMeasurements,l as setExtParams,h as setupPostMessageListeners};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "generio-sdk",
3
- "version": "1.0.39",
3
+ "version": "1.0.41",
4
4
  "description": "SDK library for generio integration",
5
5
  "type": "module",
6
6
  "license": "MIT",