generio-sdk 1.0.43 → 1.0.45
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 +6 -5
- package/dist/index.js +1 -1
- package/package.json +4 -3
package/dist/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ interface RecognizeExaminationInputModel {
|
|
|
8
8
|
//#region src/models/RecognizeExaminationOutputModel.d.ts
|
|
9
9
|
interface RecognizeExaminationOutputModel {
|
|
10
10
|
isSuccess: boolean;
|
|
11
|
+
isRecognized: boolean;
|
|
11
12
|
examinationElementId?: number;
|
|
12
13
|
sectionId?: number;
|
|
13
14
|
url?: string;
|
|
@@ -225,14 +226,14 @@ declare function SET_GENERIO_ORIGIN(newOrigin: string): void;
|
|
|
225
226
|
declare function GENERIO_ORIGIN(): string;
|
|
226
227
|
declare const GENERIO_IS_LOGGED_IN = "generio-is-logged-in";
|
|
227
228
|
declare const GENERIO_LOGGED_IN_EMAIL = "generio-logged-in-email";
|
|
229
|
+
declare function login(model: LoginInputModel): Promise<LoginOutputModel>;
|
|
230
|
+
declare function logout(): Promise<LogoutOutputModel>;
|
|
228
231
|
declare function recognizeExamination(model: RecognizeExaminationInputModel): Promise<RecognizeExaminationOutputModel>;
|
|
229
|
-
declare function
|
|
230
|
-
declare function sendMeasurements(model: SendMeasurementsInputModel): Promise<SendMeasurementsOutputModel>;
|
|
232
|
+
declare function loadExamination(examinationId: number, studyInstanceUId: string): Promise<OriginDetail>;
|
|
231
233
|
declare function getExtParamValueByStudyInstanceUId(model: GetExtParamValueByStudyInstanceUIdInputModel): Promise<GetExtParamValueByStudyInstanceUIdOutputModel>;
|
|
234
|
+
declare function setExtParams(model: SetExtParamsInputModel, window: Window): Promise<SetExtParamsOutputModel>;
|
|
235
|
+
declare function sendMeasurements(model: SendMeasurementsInputModel): Promise<SendMeasurementsOutputModel>;
|
|
232
236
|
declare function getExaminationMessage(): Promise<GetExaminationMessageOutputModel>;
|
|
233
|
-
declare function login(model: LoginInputModel): Promise<LoginOutputModel>;
|
|
234
|
-
declare function logout(): Promise<LogoutOutputModel>;
|
|
235
237
|
declare function setupPostMessageListeners(generioReadyHandler?: (payload: GenerioReadyOutputModel, event: MessageEvent) => void): void;
|
|
236
|
-
declare function loadExamination(examinationId: number, studyInstanceUId: string): Promise<OriginDetail>;
|
|
237
238
|
//#endregion
|
|
238
239
|
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, GenerioReadyOutputModel, 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
|
|
1
|
+
import*as e from"post-robot";import{v4 as t}from"uuid";let n=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 r=class{constructor(){}ConvertExaminationDataToElementRows(e){let t=[],r=0,i={subRows:[]},a=[],o=[];do{do{do{if(e[r]?.formType==n.NewLine)break;if(e[r])switch(e[r].formType){case n.DropDownList:{let t=this.CreateColumnFromExaminationData(e[r]);t.elementIndex=r;let i=[],a=1;do{let n=this.CreateColumnFromExaminationData(e[r]);n.elementIndex=r;let o=e[r]?.formValue?.trim();a===1&&o&&!o.startsWith(`-`)&&!o.endsWith(`-`)&&(t.preselected=!0),i.push(n),r++,a++}while(e[r]?.formType==n.DropDownList&&r<e.length);t.elementSelectOptions=i,o.push(t),r--;break}case n.Text:case n.Append:if(e[r]?.formValue){let t=this.CreateColumnFromExaminationData(e[r]);t.elementIndex=r,o.push(t)}break;case n.InputText:{let t=this.CreateColumnFromExaminationData(e[r]);t.elementIndex=r,t.isDistance=this.IsDistanceDefinition(e[r+1]?.formValue??``),o.push(t);break}case n.BoldText:case n.CheckBox:case n.Button:case n.DigitBox:case n.RememberedText:case n.InputTable:case n.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,t.push(i)),a=[],i={},e[r]?.formType==n.NewLine&&e[r]?.formValue?i.showHideElementId=e[r].formValue??``:i.showHideElementId=``,e[r]?.formType==n.NewLine&&e[r]?.conclusion&&e[r]?.conclusion==`hr`?i.hrBeforeRow=!0:i.hrBeforeRow=!1,r++}while(r<e.length);return t}CreateColumn(e,n,r,i,a,o,s){return{formTypeId:e,formValue:n,finding:r,conclusion:i,guid:a??t(),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 i=`https://gener.io`;function a(e){i=e}function o(){return i}const s=`generio-is-logged-in`,c=`generio-logged-in-email`;async function l(e){return(await fetch(o()+`/api/cookiesAuth/login`,{method:`POST`,credentials:`include`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)})).ok?{isSuccess:!0}:{isSuccess:!1}}async function u(){let e=await fetch(o()+`/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 d(e){let t=o()+`/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():{}}async function f(e,t){let n=await fetch(o()+`/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()}async function p(e){let t=o()+`/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 m(t,n){let{data:r}=await e.send(n,`setExtParams`,t,{domain:o()});return r}async function h(e){let t=o()+`/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():{}}async function g(){let e=o()+`/api/generioApp/getExaminationMessage`,t=await fetch(e,{method:`POST`,credentials:`include`,headers:{"Content-Type":`application/json`}});return t.ok?t.json():{}}function _(e){window.addEventListener(`message`,t=>{o()==t.origin&&(console.info(`PostMessageListener: Received message from origin: ${t.origin}`,t.data),t.data.action==`generioReady`&&e&&e(t.data.payload,t))},!1)}export{r as ExaminationDataHelpers,n as FormTypeEnum,s as GENERIO_IS_LOGGED_IN,c as GENERIO_LOGGED_IN_EMAIL,o as GENERIO_ORIGIN,a as SET_GENERIO_ORIGIN,g as getExaminationMessage,p as getExtParamValueByStudyInstanceUId,f as loadExamination,l as login,u as logout,d as recognizeExamination,h as sendMeasurements,m as setExtParams,_ as setupPostMessageListeners};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "generio-sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.45",
|
|
4
4
|
"description": "SDK library for generio integration",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -32,13 +32,14 @@
|
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@types/node": "^24.9.1",
|
|
34
34
|
"@types/post-robot": "^10.0.6",
|
|
35
|
+
"@types/uuid": "^11.0.0",
|
|
35
36
|
"bumpp": "^10.3.1",
|
|
36
37
|
"tsdown": "^0.15.11",
|
|
37
38
|
"typescript": "^5.9.3",
|
|
38
|
-
"vitest": "^4.0.4"
|
|
39
|
-
"@types/uuid": "^11.0.0"
|
|
39
|
+
"vitest": "^4.0.4"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
+
"post-robot": "^8.0.32",
|
|
42
43
|
"uuid": "^11.1.0"
|
|
43
44
|
}
|
|
44
45
|
}
|