{"version":3,"names":["loader","define","requireModule","require","requirejs","printObject","o","shift","out","p","value","global","dict","obj","Object","create","undefined","oldGlobals","id","pending","mod","findModule","i","length","exports","module","noConflict","aliases","oldName","newName","hasOwnProperty","makeDefaultExport","registry","uuid","defaultDeps","Module","deps","callback","alias","this","hasExportsAsDep","isAlias","reified","Array","state","noop","Alias","referrer","Error","missingModule","findDeps","push","resolve","child","charAt","parts","split","parentBase","slice","l","part","pop","join","has","prototype","isExtensible","wrapModules","reify","result","apply","unsee","_reify","dep","entry","makeRequire","r","moduleId","arguments","unsupportedModule","isArray","name","defaultExport","target","entries","_eak_seen","clear","factory","document","w","window","noGlobal","arr","getProto","getPrototypeOf","flat","array","call","concat","indexOf","class2type","toString","hasOwn","fnToString","ObjectFunctionString","support","isFunction","nodeType","item","isWindow","preservedScriptAttributes","type","src","nonce","noModule","DOMEval","code","node","doc","val","script","createElement","text","getAttribute","setAttribute","head","appendChild","parentNode","removeChild","toType","version","rhtmlSuffix","jQuery","selector","context","fn","init","isArrayLike","nodeName","elem","toLowerCase","jquery","constructor","toArray","get","num","pushStack","elems","ret","merge","prevObject","each","map","first","eq","last","even","grep","_elem","odd","len","j","end","sort","splice","extend","options","copy","copyIsArray","clone","deep","isPlainObject","expando","Math","random","replace","isReady","error","msg","proto","Ctor","isEmptyObject","globalEval","textContent","documentElement","nodeValue","makeArray","results","inArray","isXMLDoc","namespace","namespaceURI","docElem","ownerDocument","test","second","invert","matches","callbackExpect","arg","guid","Symbol","iterator","_i","whitespace","rtrimCSS","RegExp","contains","a","b","bup","compareDocumentPosition","rcssescape","fcssescape","ch","asCodePoint","charCodeAt","escapeSelector","sel","preferredDoc","pushNative","Expr","outermostContext","sortInput","hasDuplicate","documentIsHTML","rbuggyQSA","dirruns","done","classCache","createCache","tokenCache","compilerCache","nonnativeSelectorCache","sortOrder","booleans","identifier","attributes","pseudos","rwhitespace","rcomma","rleadingCombinator","rdescend","rpseudo","ridentifier","matchExpr","ID","CLASS","TAG","ATTR","PSEUDO","CHILD","bool","needsContext","rinputs","rheader","rquickExpr","rsibling","runescape","funescape","escape","nonHex","high","String","fromCharCode","unloadHandler","setDocument","inDisabledFieldset","addCombinator","disabled","dir","next","childNodes","e","els","find","seed","m","nid","match","groups","newSelector","newContext","exec","getElementById","getElementsByTagName","getElementsByClassName","testContext","scope","tokenize","toSelector","querySelectorAll","qsaError","removeAttribute","select","keys","cache","key","cacheLength","markFunction","assert","el","createInputPseudo","createButtonPseudo","createDisabledPseudo","isDisabled","createPositionalPseudo","argument","matchIndexes","subWindow","webkitMatchesSelector","msMatchesSelector","defaultView","top","addEventListener","getById","getElementsByName","disconnectedMatch","cssHas","querySelector","filter","attrId","getAttributeNode","tag","className","input","innerHTML","compare","sortDetached","expr","elements","matchesSelector","attr","attrHandle","uniqueSort","duplicates","sortStable","createPseudo","relative","preFilter","excess","unquoted","nodeNameSelector","expectedNodeName","pattern","operator","check","what","_argument","simple","forward","ofType","_context","xml","outerCache","nodeIndex","start","parent","useCache","diff","firstChild","lastChild","pseudo","args","setFilters","idx","matched","not","matcher","compile","unmatched","lang","elemLang","hash","location","root","focus","activeElement","err","safeActiveElement","hasFocus","href","tabIndex","enabled","checked","selected","selectedIndex","empty","nextSibling","header","button","_matchIndexes","lt","gt","nth","radio","checkbox","file","password","image","submit","reset","parseOnly","tokens","soFar","preFilters","cached","combinator","base","skip","checkNonElements","doneName","oldCache","newCache","elementMatcher","matchers","condense","newUnmatched","mapped","setMatcher","postFilter","postFinder","postSelector","temp","matcherOut","preMap","postMap","preexisting","contexts","multipleContexts","matcherIn","matcherFromTokens","checkContext","leadingRelative","implicitRelative","matchContext","matchAnyContext","setMatchers","elementMatchers","bySet","byElement","superMatcher","outermost","matchedCount","setMatched","contextBackup","dirrunsUnique","matcherFromGroupMatchers","token","compiled","filters","unique","getText","isXML","selectors","until","truncate","is","siblings","n","rneedsContext","rsingleTag","winnow","qualifier","self","rootjQuery","parseHTML","ready","rparentsprev","guaranteedUnique","children","contents","prev","sibling","cur","targets","closest","index","prevAll","add","addBack","parents","parentsUntil","nextAll","nextUntil","prevUntil","contentDocument","content","reverse","rnothtmlwhite","Identity","v","Thrower","ex","adoptValue","reject","noValue","method","promise","fail","then","Callbacks","object","_","flag","createOptions","firing","memory","fired","locked","list","queue","firingIndex","fire","once","stopOnFalse","remove","disable","lock","fireWith","Deferred","func","tuples","always","deferred","catch","pipe","fns","newDefer","tuple","returned","progress","notify","onFulfilled","onRejected","onProgress","maxDepth","depth","handler","special","that","mightThrow","TypeError","notifyWith","resolveWith","process","exceptionHook","rejectWith","getErrorHook","getStackHook","setTimeout","stateString","when","singleValue","remaining","resolveContexts","resolveValues","primary","updateFunc","rerrorNames","asyncError","console","warn","message","stack","readyException","readyList","completed","removeEventListener","readyWait","wait","readyState","doScroll","access","chainable","emptyGet","raw","bulk","_key","rmsPrefix","rdashAlpha","fcamelCase","_all","letter","toUpperCase","camelCase","string","acceptData","owner","Data","uid","defineProperty","configurable","set","data","prop","hasData","dataPriv","dataUser","rbrace","rmultiDash","dataAttr","JSON","parse","getData","removeData","_data","_removeData","attrs","dequeue","startLength","hooks","_queueHooks","unshift","stop","setter","clearQueue","tmp","count","defer","pnum","source","rcssNum","cssExpand","isAttached","composed","getRootNode","isHiddenWithinTree","style","display","css","adjustCSS","valueParts","tween","adjusted","scale","maxIterations","currentValue","initial","unit","cssNumber","initialInUnit","defaultDisplayMap","getDefaultDisplay","body","showHide","show","values","hide","toggle","div","rcheckableType","rtagName","rscriptType","createDocumentFragment","checkClone","cloneNode","noCloneChecked","defaultValue","option","wrapMap","thead","col","tr","td","_default","getAll","setGlobalEval","refElements","tbody","tfoot","colgroup","caption","th","optgroup","rhtml","buildFragment","scripts","selection","ignored","wrap","attached","fragment","nodes","htmlPrefilter","createTextNode","rtypenamespace","returnTrue","returnFalse","on","types","one","origFn","event","off","leverageNative","isSetup","saved","isTrigger","delegateType","stopPropagation","stopImmediatePropagation","preventDefault","trigger","isImmediatePropagationStopped","handleObjIn","eventHandle","events","t","handleObj","handlers","namespaces","origType","elemData","handle","triggered","dispatch","bindType","delegateCount","setup","mappedTypes","origCount","teardown","removeEvent","nativeEvent","handlerQueue","fix","delegateTarget","preDispatch","isPropagationStopped","currentTarget","rnamespace","postDispatch","matchedHandlers","matchedSelectors","addProp","hook","Event","enumerable","originalEvent","writable","load","noBubble","click","beforeunload","returnValue","props","isDefaultPrevented","defaultPrevented","relatedTarget","timeStamp","Date","now","isSimulated","altKey","bubbles","cancelable","changedTouches","ctrlKey","detail","eventPhase","metaKey","pageX","pageY","shiftKey","view","char","charCode","keyCode","buttons","clientX","clientY","offsetX","offsetY","pointerId","pointerType","screenX","screenY","targetTouches","toElement","touches","which","blur","focusMappedHandler","documentMode","simulate","attaches","dataHolder","mouseenter","mouseleave","pointerenter","pointerleave","orig","related","rnoInnerhtml","rchecked","rcleanScript","manipulationTarget","disableScript","restoreScript","cloneCopyEvent","dest","udataOld","udataCur","fixInput","domManip","collection","hasScripts","iNoClone","valueIsFunction","html","_evalUrl","keepData","cleanData","dataAndEvents","deepDataAndEvents","srcElements","destElements","inPage","detach","append","prepend","insertBefore","before","after","replaceWith","replaceChild","appendTo","prependTo","insertAfter","replaceAll","original","insert","rnumnonpx","rcustomProp","getStyles","opener","getComputedStyle","swap","old","rboxStyle","curCSS","computed","width","minWidth","maxWidth","isCustomProp","getPropertyValue","pixelBoxStyles","addGetHookIf","conditionFn","hookFn","computeStyleTests","container","cssText","divStyle","pixelPositionVal","reliableMarginLeftVal","roundPixelMeasures","marginLeft","right","pixelBoxStylesVal","boxSizingReliableVal","position","scrollboxSizeVal","offsetWidth","measure","round","parseFloat","reliableTrDimensionsVal","backgroundClip","clearCloneStyle","boxSizingReliable","pixelPosition","reliableMarginLeft","scrollboxSize","reliableTrDimensions","table","trChild","trStyle","height","parseInt","borderTopWidth","borderBottomWidth","offsetHeight","cssPrefixes","emptyStyle","vendorProps","finalPropName","final","cssProps","capName","vendorPropName","rdisplayswap","cssShow","visibility","cssNormalTransform","letterSpacing","fontWeight","setPositiveNumber","subtract","max","boxModelAdjustment","dimension","box","isBorderBox","styles","computedVal","extra","delta","marginDelta","ceil","getWidthOrHeight","valueIsBorderBox","offsetProp","getClientRects","Tween","easing","cssHooks","opacity","animationIterationCount","aspectRatio","borderImageSlice","columnCount","flexGrow","flexShrink","gridArea","gridColumn","gridColumnEnd","gridColumnStart","gridRow","gridRowEnd","gridRowStart","lineHeight","order","orphans","widows","zIndex","zoom","fillOpacity","floodOpacity","stopOpacity","strokeMiterlimit","strokeOpacity","origName","setProperty","isFinite","getBoundingClientRect","scrollboxSizeBuggy","left","margin","padding","border","prefix","suffix","expand","expanded","propHooks","run","percent","eased","duration","pos","step","fx","scrollTop","scrollLeft","linear","swing","cos","PI","fxNow","inProgress","rfxtypes","rrun","schedule","hidden","requestAnimationFrame","interval","tick","createFxNow","genFx","includeWidth","createTween","animation","Animation","tweeners","properties","stopped","prefilters","currentTime","startTime","tweens","opts","specialEasing","originalProperties","originalOptions","gotoEnd","propFilter","bind","complete","timer","anim","tweener","oldfire","propTween","restoreDisplay","isBox","dataShow","unqueued","overflow","overflowX","overflowY","prefilter","speed","opt","speeds","fadeTo","to","animate","optall","doAnimation","finish","stopQueue","timers","cssFn","slideDown","slideUp","slideToggle","fadeIn","fadeOut","fadeToggle","slow","fast","delay","time","timeout","clearTimeout","checkOn","optSelected","radioValue","boolHook","removeAttr","nType","attrHooks","attrNames","getter","lowercaseName","rfocusable","rclickable","stripAndCollapse","getClass","classesToArray","removeProp","propFix","tabindex","for","class","addClass","classNames","curValue","finalValue","removeClass","toggleClass","stateVal","isValidValue","hasClass","rreturn","valHooks","optionSet","rquery","parseXML","parserErrorElem","DOMParser","parseFromString","rfocusMorph","stopPropagationCallback","onlyHandlers","bubbleType","ontype","lastElement","eventPath","parentWindow","triggerHandler","rbracket","rCRLF","rsubmitterTypes","rsubmittable","buildParams","traditional","param","s","valueOrFunction","encodeURIComponent","serialize","serializeArray","r20","rhash","rantiCache","rheaders","rnoContent","rprotocol","transports","allTypes","originAnchor","addToPrefiltersOrTransports","structure","dataTypeExpression","dataType","dataTypes","inspectPrefiltersOrTransports","jqXHR","inspected","seekingTransport","inspect","prefilterOrFactory","dataTypeOrTransport","ajaxExtend","flatOptions","ajaxSettings","active","lastModified","etag","url","isLocal","protocol","processData","async","contentType","accepts","json","responseFields","converters","ajaxSetup","settings","ajaxPrefilter","ajaxTransport","ajax","transport","cacheURL","responseHeadersString","responseHeaders","timeoutTimer","urlAnchor","fireGlobals","uncached","callbackContext","globalEventContext","completeDeferred","statusCode","requestHeaders","requestHeadersNames","strAbort","getResponseHeader","getAllResponseHeaders","setRequestHeader","overrideMimeType","mimeType","status","abort","statusText","finalText","crossDomain","host","hasContent","ifModified","headers","beforeSend","success","send","nativeStatusText","responses","isSuccess","response","modified","ct","finalDataType","firstDataType","ajaxHandleResponses","conv2","current","conv","dataFilter","throws","ajaxConvert","getJSON","getScript","wrapAll","firstElementChild","wrapInner","htmlIsFunction","unwrap","visible","xhr","XMLHttpRequest","xhrSuccessStatus","xhrSupported","cors","errorCallback","open","username","xhrFields","onload","onerror","onabort","ontimeout","onreadystatechange","responseType","responseText","binary","scriptAttrs","charset","scriptCharset","evt","oldCallbacks","rjsonp","jsonp","jsonpCallback","originalSettings","callbackName","overwritten","responseContainer","jsonProp","createHTMLDocument","implementation","keepScripts","parsed","params","animated","offset","setOffset","curPosition","curLeft","curCSSTop","curTop","curOffset","curCSSLeft","curElem","using","rect","win","pageYOffset","pageXOffset","offsetParent","parentOffset","scrollTo","Height","Width","defaultExtra","funcName","unbind","delegate","undelegate","hover","fnOver","fnOut","rtrim","proxy","holdReady","hold","parseJSON","isNumeric","isNaN","trim","amd","_jQuery","_$","$","default","__esModule","arrayPrototype","typedArrayPrototype","typedArrayLength","Function","getOwnPropertyDescriptor","toIntegerOrInfinity","Number","POSITIVE_INFINITY","NEGATIVE_INFINITY","floor","abs","toObject","lengthOfArrayLike","min","MAX_SAFE_INTEGER","assertTypedArray","typedArrayNameInternalSlot","toStringTag","typedArrayCreate","example","arrayName","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array","transfer","srcStart","srcStep","targetStart","targetStep","from","typedArrayNumberConversion","asNumber","isBigIntArray","BigInt","defineArrayMethods","def","defineMethods","forEach","unscopables","defineTypedArrayMethods","toReversed","toSorted","compareFn","toSpliced","deleteCount","actualStart","actualDeleteCount","newLen","argsCount","relativeStart","insertCount","dc","calculateSplice","E","fromValue","doSplice","relativeIndex","actualIndex","RangeError","k","INITIAL_STATE","session","PcscReaders","cpxCard","DMPenabled","cpxCardRead","vitaleCard","vitaleCardRead","DmpConnector","DcParameterRegistered","INITIAL_DMP_STATE","certifiedIdentity","directAuthenticationStatus","sendCommandUsingWebSocket","sendUsingWsBtn","DMPConnect","logCallbackFunc","refreshCallbackFunc","errorHandler","initCallback","localServerPort","localServerDomain","_port","_sessionId","_logCallback","_refreshCallback","_errorHandler","_serverDomain","_serverPort","_serverUrl","_state","_dmpState","getXhr","ActiveXObject","alert","getState","dmp","setState","setDmpState","resetState","getSessionId","sendCommand","command","timeoutInSeconds","answerCallback","persistentSocket","wrapperCallback","createWrapperError","WrapperErrorCode","InitializationError","BrowserNotSupported","ws","WebSocket","onopen","stringify","forceCloseSocket","close","ServerTimeout","exception","SocketError","onmessage","receivedData","s_status","keepSending","onclose","reason","wasClean","errorDesc","ConnectionClosedError","sendPostApiCommand","aCommandData","aCommandName","aTimeoutInSecond","aCallBackFunction","s_commandName","log","jsonData","sendURLCommand","entrypoint","param1","val1","param2","val2","param3","val3","param4","val4","body_val","fetch","Authorization","sendHttpCommand","anEntryPoint","ErrorType","ApiErrors","DMPErrors","CurlErrors","VitaleErrors","MssErrors","TlsiErrors","DpErrors","WrapperErrors","DmpConnectJsSoftwareErrors","UnexpectedResponse","DmpConnectJsErrorCodes","ErrTechnical","ErrFunctional","ErrInvalidSession","errorCode","errorTypeDescription","errorContext","errorExtendedInformations","i_apiErrorType","i_apiErrorCode","s_apiErrorDescription","s_apiErrorTypeDescription","s_apiErrorContext","s_apiErrorExtendedInformations","hl_openSession","optionalParameters","resultCallback","i_timeoutInSeconds","paramName","s_sessionId","hl_getTimeSynchronizationDifference","i_forceNtpSync","hl_crash","hl_zombie","sendRequest","requestBodyJson","hl_generateUniqueId","anUniqueIdType","i_type","hl_openSessionWithCustomDcParam","aDcParameter","s_dcparameters64","hl_startDummyMonitoring","hl_startCpxCardMonitoring","checkingIntervalInSeconds","i_checkingInterval","hl_startVitaleCardMonitoring","hl_startRemoteControl","hl_stopRemoteControl","hl_remoteControlStatus","hl_startRemoteControlInMonitoring","hl_sendRemoteInAnswer","answerObject","assign","hl_exportDocumentToRemoteOut","aDocumentHandle","i_documentHandle","hl_exportDocumentToRemoteOutByUniqueId","anIns","aDocumentUniqueId","aDocumentUuid","s_ins","s_documentUniqueId","s_documentUuid","hl_exportDocumentToXml","hl_exportDocumentToXmlByUniqueId","hl_notifyPsConnectedToRemoteOut","hl_notifyPsLoggedOutToRemoteOut","hl_notifyPsConnectionToRemoteOut","connectionStatus","hl_sendRemoteOutMessage","Message","hl_sessionRemoteControlStatus","aDcparam","hl_getTseRemoteControlStatus","aTseCredential","s_tseCredentials","hl_startPrintedDocumentsMonitoring","hl_flushPrintedDocuments","documentsIds","s_documentIds","hl_getPrintedDocumentsCount","hl_getPrintedDocuments","hl_getNextPrintedDocument","hl_closeSession","ReaderSlotType","ST_NO_CARD","ST_VITALE_CARD","ST_CPS_CARD","ST_OTHER","ST_UNKNOWN","ReaderAccessMode","AM_FULL_PCSC","AM_GALSS_PCSC","AM_GALSS_TL","AM_GALSS_RAC","hl_getPcscReaders","hl_getCpxCard","readerNumber","readerName","s_readerName","i_readerNumber","hl_updateCpxAuthenticationToken","authToken","s_authenticationToken","hl_getCpxHpInfos","hl_getVitaleCard","hl_updateVitaleAuthenticationToken","hl_signWithCpxCard","pinCode","s_pinCode","s_stringToSign","i_digestType","hl_readCpxCard","i_returnCertificates","hl_checkCpxTokenStatus","optionalParams","hl_checkVitaleTokenStatus","hl_getCpxStatus","hl_checkUserLicenseRight","VitaleStatus","ApiError","MissingCard","ProdCard","TestCard","DemoCard","hl_readVitaleCard","i_getXmlContent","hl_getDcParamRegistered","hl_setVitaleXmlContent","xmlContent","aCardType","s_xmlContent","i_cardType","hl_getObjectParameters","hl_getSessionState","hl_sessionExists","hl_createConnection","hl_getInteropCodes","hl_getCisCodes","hl_getAtcCodes","hl_getUpdatedTypeCode","typeCode","s_typeCode","hl_getNosTableNames","hl_getNosCodes","tableArray","TableNames","hl_getCiSisTableNames","hl_getCiSisCodes","hl_setSessionData","hl_getSessionData","hl_removeSessionData","hl_clearSessionData","hl_getSessionDataSize","hl_getMaximumSessionDataSize","hl_setPersistantData","hl_getPersistantData","hl_clearPersistantData","hl_getPersistantDataSize","hl_getMaximumPersistantDataSize","lowLevelApiFunctionCall","commandName","commandParameters","getParameterString","getParameterStringSize","getParameterInt","getObjectParameterStringSize","getObjectParameterString","getObjectParameterInt","getObjectParameterFloat","getObjectFromList","getListSize","copyObjectFromList","handleExists","checkValidity","getHandleType","createObject","releaseObject","releaseList","releaseErrorObject","getLogsTail","hl_getSessionLogsTail","hl_getSystemInformation","hl_activeFeatures","hl_isWirelessModeEnabled","getLogLevels","setLogLevels","iDmpConnectLevel","iDmpConnectJsLevel","i_dmpConnectLogLevel","i_dmpConnectJsLogLevel","hl_convertLunarDateToStandardDate","aDate","s_date","hl_convertPdfToPdfA1","pdfInBase64","s_contentInBase64","hl_computeBirthDayCentury","aQuality","i_quality","hl_regularizeBirthDateIfNeeded","hl_getDocumentFromCda","aDocumentInBase64","s_cdaContentInBase64","hl_getDocumentsFromIheXdm","s_iheXdmContentArchiveInBase64","DMPCONNECT_VERSION_MAJOR","DMPCONNECT_VERSION_MINOR","DMPCONNECT_VERSION_BUILD","LogVerbosity","Disabled","Fatal","Errors","Warnings","Infos","Dev","ConsoleOutputMode","ConsoleOutputEnabled","ConsoleOutputDisabled","HandleType","HandleType_Undefined","HandleType_List","HandleType_Error","HandleType_GalssResource","HandleType_Galss","HandleType_PcscResource","HandleType_Pcsc","HandleType_Vitale","HandleType_VitalePatient","HandleType_TimeProvider","HandleType_HP","HandleType_SubmissionSet","HandleType_Document","HandleType_Connection","HandleType_DmpConnector","HandleType_Certificate","HandleType_PracticeLocation","HandleType_EventCode","HandleType_CPx","HandleType_CPxPkcsToken","HandleType_Filter","GlobalParameterName","VersionName","PatientWebAccessPdfStoragePath","PatientWebAccessPdfTemplateFilename","PatientWebAccessPdfDefaultUrl","CryptolibCpsDllFilename","VersionMajor","VersionMinor","VersionBuild","CurrentTimeProvider","Pkcs11EngineIsInitialized","ObjectParameterName","ErrorDescription","ErrorContext","ErrorExtendedInformations","TimeProviderIp","ConnectionUrl","ConnectionProxyIp","ConnectionProxyLogin","ConnectionProxyPassword","HpName","HpGiven","HpProfession","HpProfessionOid","HpProfessionDescription","HpSpeciality","HpSpecialityDescription","HpInternalId","PracticeLocationName","PracticeLocationActivity","PracticeLocationPracticeSettings","PracticeLocationHealthcareSettings","DmpConnectorUniqueId","DmpConnectorDumpPath","DmpConnectorLocalPatientRootOid","DocumentUniqueId","DocumentContent","DocumentCreationDate","DocumentServiceStartDate","DocumentServiceStopDate","DocumentCda_CrBioSetIdRoot","DocumentCda_CrBioSetIdExtension","DocumentCda_CrBioVersionNumber","SubmissionSetTitle","SubmissionSetDescription","SubmissionSetLocalPatientId","EventCodeCode","EventCodeDescription","CertificateFilename","CertificatePassPhrase","GalssResourceName","GalssFilename","PcscResourceName","VitaleApiLecFilename","VitaleCurrentReaderName","VitaleXmlContent","VitalePatientName","VitalePatientBirthname","VitalePatientGiven","VitalePatientBirthday","VitalePatientIns","VitalePatientXml","VitalePatientNir","VitalePatientCertifiedNir","FilterCategoriesList","FilterFormatsList","FilterPracticesList","FilterBottomCreationDate","FilterTopCreationDate","FilterBottomServiceStartDate","FilterTopServiceStartDate","FilterBottomSubmissionDate","FilterTopSubmissionDate","DocumentTitle","DocumentDescription","DocumentClassCode","DocumentTypeCode","DocumentHealthCareFacilityTypeCode","DocumentPracticeSettingCode","DocumentPatientIns","DocumentHash","DocumentXDSMetadata","DocumentSubmissionDate","DocumentUUId","DocumentPreviousUUId","DocumentNextUUId","DocumentCDAContent","CpxSerialNumber","CpxReaderName","CpxValidityDate","ErrorCode","TimeProviderPort","ConnectionTimeOut","ConnectionProxyPort","DocumentSize","DocumentPdfFormatConversionEnabled","VitalePatientInsAvailable","TimeProviderSynchronizationDifference","ConnectionAuthenticationToken","ConnectionCaCertificate","DmpConnectorConnection","DmpConnectorPracticeLocation","DmpConnectorUser","DocumentPerformer","DocumentAuthors","DocumentEventCodes","SubmissionSetDocuments","PracticeLocationSignatureCertificate","ErrorTypeCode","GalssResourceEntryType","GalssResourceEntryProtocol","EventCodeClassification","VitaleCardType","HpAuthenticationMode","DocumentPerformerRole","CPxCardType","CpxType","FilterDocumentStatus","FilterDocumentVisibility","Document_Status","Document_Visibility","Document_Format","CPxType","CPS","CPF","CPE","CPA","CardDemoStatus","Real","Demo","IdentifierType","IdentifierType_PatientIns","IdentifierType_PatientInsC","IdentifierType_NationalIdentifierRpps","IdentifierType_NationalIdentifierAdeli","IdentifierType_NationalIdentifierSirius","IdentifierType_NationalIdentifierStudent","IdentifierType_InternalIdentifierAdeli","IdentifierType_InternalIdentifierFiness","IdentifierType_InternalIdentifierSiren","IdentifierType_InternalIdentifierSiret","IdentifierType_InternalIdentifierRpps","IdentifierType_InternalIdentifier","InformantType","InformantType_Informant","InformantType_EmergencyContact","InformantType_TrustedContact","InformantType_Unknown","InformantRelationType","InformantRelationType_Mother","InformantRelationType_Father","InformantRelationType_NaturalMother","InformantRelationType_NaturalFather","InformantRelationType_StepMother","InformantRelationType_StepFather","InformantRelationType_GrandMother","InformantRelationType_GrandFather","InformantRelationType_GrandGrandMother","InformantRelationType_GrandGrandFather","InformantRelationType_NaturalDaughter","InformantRelationType_NaturalSon","InformantRelationType_Brother","InformantRelationType_Sister","InformantRelationType_HalfBrother","InformantRelationType_HalfSister","InformantRelationType_GrandDaughter","InformantRelationType_GrandSon","InformantRelationType_Uncle","InformantRelationType_Aunt","InformantRelationType_Nephew","InformantRelationType_Niece","InformantRelationType_Husband","InformantRelationType_Wife","InformantRelationType_CivilUnion","InformantRelationType_SameAddress","InformantRelationType_Friend","InformantRelationType_Neighbor","InformantRelationType_FamilyMember","InformantRelationType_Child","InformantRelationType_Cousin","InformantRelationType_Spouse","InformantRelationType_Daughter","InformantRelationType_Son","InformantRelationType_Guardian","InformantRelationType_Curator","InformantRelationType_Agent","InformantRelationType_Unknown","TelecomType","TelecomType_Phone","TelecomType_Fax","TelecomType_Mail","TelecomType_HTTP","TelecomType_FTP","TelecomType_MLLP","TelecomType_Unknown","TelecomUsage","TelecomUsage_Home","TelecomUsage_MainHome","TelecomUsage_Holiday","TelecomUsage_Workplace","TelecomUsage_Direct","TelecomUsage_Public","TelecomUsage_Emergency","TelecomUsage_Mobile","TelecomUsage_Pager","TelecomUsage_Unknown","AddressType","AddressType_Home","AddressType_MainHome","AddressType_Holiday","AddressType_Workplace","AddressType_Temporary","AddressType_Unknown","StreetNameType","StreetNameType_Alley","StreetNameType_Avenue","StreetNameType_Boulevard","StreetNameType_Center","StreetNameType_CommercialCenter","StreetNameType_Building","StreetNameType_Impasse","StreetNameType_Locality","StreetNameType_Subdivision","StreetNameType_Passage","StreetNameType_Place","StreetNameType_Residence","StreetNameType_Rundabout","StreetNameType_Road","StreetNameType_Street","StreetNameType_Square","StreetNameType_Village","StreetNameType_Area","StreetNameType_DevelopmentZone","StreetNameType_HoldingZone","StreetNameType_IndustrialZone","StreetNameType_Unknown","ImmunizationType","ImmunizationType_Unknown","ImmunizationType_FirstSerie","ImmunizationType_Booster","ImmunizationRouteType","ImmunizationRouteType_Unknown","ImmunizationRouteType_IntramuscularInjection","ImmunizationRouteType_IntracutaneousInjection","ImmunizationRouteType_Inhalation","ImmunizationRouteType_Oral","ImmunizationRouteType_SubcutaneousInjection","ImmunizationApproachSite","ImmunizationApproachSite_Unknown","ImmunizationApproachSite_Buttock","ImmunizationApproachSite_LeftDeltoid","ImmunizationApproachSite_RightDeltoid","ImmunizationApproachSite_LeftThigh","ImmunizationApproachSite_RightThigh","CDASectionType","CDASectionType_Immunizations","Hl7AuthorityIdentifierType","Hl7AuthorityIdentifierType_Name","Hl7AuthorityIdentifierType_GeographicFiness","Hl7AuthorityIdentifierType_JuridicFiness","Hl7AuthorityIdentifierType_Iso","Hl7IdentityReliabilityCode","Hl7IdentityReliability_Empty","Hl7IdentityReliability_Temporary","Hl7IdentityReliability_Valid","Hl7IdentityReliability_Slave","Hl7IdentityReliability_Disabled","Hl7IdentityReliability_PutativeDuplicate","Hl7IdentityReliability_ProvedDuplicate","Hl7IdentityReliability_PutativeCollision","Hl7IdentityReliability_ValidatedCollision","Hl7IdentityReliability_Filiation","Hl7IdentityReliability_Hidden","Hl7IdentityReliability_Anonymous","Hl7IdentityReliability_CheckedPyPatient","Hl7IdentityReliability_ReceivedFromAnotherDomain","Hl7IdentityReliability_ClearedByAnotherDomain","Hl7IdentityReliability_Theft","Hl7IdentityReliability_DetectedNamesake","Hl7IdentityReliability_ProvedNamesake","Hl7IdentityReliability_Invalid","Hl7IdentityReliability_Fictional","Hl7IdentityReliability_Doubtful","InsIdentityResult","InsIdentityResult_NoIdentityFound","InsIdentityResult_SingleIdentityFound","InsIdentityResult_MultipleIdentitiesFound","hl_getInsFromVitaleCard","lpsParams","aVitaleCardIndex","resultCallBack","LpsInfos","i_vitalePatientIndex","hl_getInsFromRawVitaleData","aBeneficiaryVitaleData","aRightHolderVitaleData","aVitaleSerialNum","BeneficiaryVitaleData","RightHolderVitaleData","s_serialNumber","hl_getInsFromIdentityInformation","given","sex","date","place","s_birthName","s_given","i_sex","s_birthDate","s_birthPlace","hl_checkInsIdentity","ins","oid","s_key","s_oid","hl_createInsiConnector","serverFullUrl","transactionsTimeoutInSeconds","practiceSetting","cpsPracticeLocationIndice","s_tlsiUrl","i_transactionsTimeout","s_practiceSetting","i_cpsPracticeLocationIndice","i_getConnectionHandle","hl_submitInsiBatchValidationSet","patientList","Patients","hl_getInsiBatchValidationSetResult","batchId","s_batchId","hl_getDataMatrix","i_getBinary","i_getBmpImage","i_getCode","hl_createDmpConnector","serverName","s_dmpUrl","substr","hl_getInsNirFromInsC","insC","s_insC","hl_setTransactionDumpSettings","i_enable","s_directory","hl_setHomologationDumpSettings","hl_setPracticeLocation","practiceLocationIndice","DMPStatus","DMPExist","DMPIsClosed","DMPNotFound","DMPError","Sex","UnknownSex","Male","Female","Gender","UnknownGender","M","Mme","UserAuthorizationStatus","AuthorizationError","AuthorizationExist","AuthorizationExpired","AuthorizationDenied","NoAuthorization","hl_getDirectAuthenticationDMPStatus","DocumentStatus","Approved","Deprecated","Archived","DocumentVisibility","Normal","PatientHidden","HealthcareProfesionnalHidden","GuardianHidden","PatientHiddenGuardianHidden","GuardianHiddenHealthcareProfesionnalHidden","DocumentFormat","PlainText","RtfText","JpgImage","TiffImage","PdfApplication","VsmDocument","CrBiologie","DluDocument","DluFludtDocument","DluFludrDocument","LdlEesDocument","LdlSesDocument","HrDocument","HvacDocument","HvacNoteDocument","DicomKosDocument","ImgCrImagerieDocument","ImgDaImagerieDocument","PerformerRole","Actor","MainActor","Assistant","EventCodeType","CCAM","SNOMED_3_5_VF","CIM_10","LOINC","DRC","hl_findDocuments","hl_getSubmissionSetDocuments","submissionSetId","s_submissionSetId","hl_getDocumentSubmissionSetIdByUniqueId","uniqueId","UserAuthorizationAction","AddAuthorization","RemoveAuthorization","hl_updateUserDmpAccessAuthorization","action","treatingPhysician","i_setTreatingPhysician","i_action","hl_getAccessibleDMPList","s_type","hl_getDocumentContent","hdoc","i_getCdaHeaders","i_getCdaContent","i_getPerformer","i_getInformants","i_getAuthors","i_getDataEnterer","i_getParticipants","i_getAuthenticators","hl_getDocumentsContent","i_handle","DocumentsHandle","hl_getDocumentsContentByUniqueId","selectedUuids","selectedUniqueIds","PatienINS","commandData","Uuids","UniqueIds","hl_getDocumentContentByUniqueId","hl_getDocumentHistoryByUniqueId","s_uniqueId","s_uuid","hl_updateDocumentVisibility","healthcareSettings","newVisibility","i_document","s_healthCareSettings","i_newVisibility","hl_updateDocumentVisibilityByUniqueId","documentUniqueId","documentUuid","hl_updateDocumentStatus","hl_updateDocumentStatusByUniqueId","hl_deleteDocument","hl_deleteArchivedDocument","hl_sendDocument","fileContentBase64","documentTitle","documentDescription","documentCategory","documentVisibility","documentFormat","healthcareSetting","replacedDocumentUniqueId","submissionSetTitle","submissionSetDescription","eventCodes","s_fileContentBase64","s_documentTitle","s_documentCategory","i_documentVisibility","s_documentFormatCode","i_documentFormat","s_healthcareSetting","s_documentDescription","s_eventCodes","s_replacedDocumentUniqueId","s_submissionSetTitle","s_submissionSetDescription","hl_validateDocuments","localPatientId","documents","s_localPatientId","Documents","hl_getCdaFromSubmissionSet","hl_sendDocuments","hl_getDocumentUuidByUniqueId","hl_getDmpAdministrativeData","GuardianStatus","NoGuardianDefined","GuardianDefined","GuardianAction","IgnoreGuardianSetup","AddGuardian","RemoveGuardian","LegalRepresentantRole","Father","Mother","StepFather","StepMother","GrandFather","GrandMother","GrandGrandFather","GrandGrandMother","Aunt","Uncle","Brother","Sister","Guardian","hl_findPatients","AccessMode","NormalAccess","BrisDeGlace","Centre15","hl_setDmpAccessMode","accessMode","i_accessMode","s_reason","hl_getWebPsDmpUrls","getPscUrl","i_getPscUrls","hl_setWebPsRootUrl","s_url","hl_getMajorityAge","hl_setConfidentialityLevel","aConfidentialityEnabler","i_enableSecretConnection","DmpAuthorizationListType","AllAuthorizations","AuthorizedUsers","DeniedUsers","hl_getDmpAuthorizationsList","anAuthorizationListType","i_authorizationType","hl_getDmpParameters","hl_setDmpParametersUrl"],"sources":["../rewritten-packages/@embroider/synthesized-vendor/vendor/loader/loader.js","../rewritten-packages/@embroider/synthesized-vendor/vendor/dmpconnectjs/dmpconnect.js","../rewritten-packages/@embroider/synthesized-vendor/vendor/jquery/jquery.js","../rewritten-packages/@embroider/synthesized-vendor/vendor/shims/jquery.js","../rewritten-packages/@embroider/synthesized-vendor/vendor/polyfill.js","../rewritten-packages/@embroider/synthesized-vendor/vendor/dmpconnectjs/dmpconnect_insi.js","../rewritten-packages/@embroider/synthesized-vendor/vendor/dmpconnectjs/dmpconnect_dmp.js"],"sourcesContent":["var loader, define, requireModule, require, requirejs;\n\n(function (global) {\n 'use strict';\n\n function dict() {\n var obj = Object.create(null);\n obj['__'] = undefined;\n delete obj['__'];\n return obj;\n }\n\n // Save off the original values of these globals, so we can restore them if someone asks us to\n var oldGlobals = {\n loader: loader,\n define: define,\n requireModule: requireModule,\n require: require,\n requirejs: requirejs\n };\n\n requirejs = require = requireModule = function (id) {\n var pending = [];\n var mod = findModule(id, '(require)', pending);\n\n for (var i = pending.length - 1; i >= 0; i--) {\n pending[i].exports();\n }\n\n return mod.module.exports;\n };\n\n loader = {\n noConflict: function (aliases) {\n var oldName, newName;\n\n for (oldName in aliases) {\n if (aliases.hasOwnProperty(oldName)) {\n if (oldGlobals.hasOwnProperty(oldName)) {\n newName = aliases[oldName];\n\n global[newName] = global[oldName];\n global[oldName] = oldGlobals[oldName];\n }\n }\n }\n },\n // Option to enable or disable the generation of default exports\n makeDefaultExport: true\n };\n\n var registry = dict();\n var seen = dict();\n\n var uuid = 0;\n\n function unsupportedModule(length) {\n throw new Error('an unsupported module was defined, expected `define(id, deps, module)` instead got: `' + length + '` arguments to define`');\n }\n\n var defaultDeps = ['require', 'exports', 'module'];\n\n function Module(id, deps, callback, alias) {\n this.uuid = uuid++;\n this.id = id;\n this.deps = !deps.length && callback.length ? defaultDeps : deps;\n this.module = { exports: {} };\n this.callback = callback;\n this.hasExportsAsDep = false;\n this.isAlias = alias;\n this.reified = new Array(deps.length);\n\n /*\n Each module normally passes through these states, in order:\n new : initial state\n pending : this module is scheduled to be executed\n reifying : this module's dependencies are being executed\n reified : this module's dependencies finished executing successfully\n errored : this module's dependencies failed to execute\n finalized : this module executed successfully\n */\n this.state = 'new';\n }\n\n Module.prototype.makeDefaultExport = function () {\n var exports = this.module.exports;\n if (exports !== null && (typeof exports === 'object' || typeof exports === 'function') && exports['default'] === undefined && Object.isExtensible(exports)) {\n exports['default'] = exports;\n }\n };\n\n Module.prototype.exports = function () {\n // if finalized, there is no work to do. If reifying, there is a\n // circular dependency so we must return our (partial) exports.\n if (this.state === 'finalized' || this.state === 'reifying') {\n return this.module.exports;\n }\n\n\n if (loader.wrapModules) {\n this.callback = loader.wrapModules(this.id, this.callback);\n }\n\n this.reify();\n\n var result = this.callback.apply(this, this.reified);\n this.reified.length = 0;\n this.state = 'finalized';\n\n if (!(this.hasExportsAsDep && result === undefined)) {\n this.module.exports = result;\n }\n if (loader.makeDefaultExport) {\n this.makeDefaultExport();\n }\n return this.module.exports;\n };\n\n Module.prototype.unsee = function () {\n this.state = 'new';\n this.module = { exports: {} };\n };\n\n Module.prototype.reify = function () {\n if (this.state === 'reified') {\n return;\n }\n this.state = 'reifying';\n try {\n this.reified = this._reify();\n this.state = 'reified';\n } finally {\n if (this.state === 'reifying') {\n this.state = 'errored';\n }\n }\n };\n\n Module.prototype._reify = function () {\n var reified = this.reified.slice();\n for (var i = 0; i < reified.length; i++) {\n var mod = reified[i];\n reified[i] = mod.exports ? mod.exports : mod.module.exports();\n }\n return reified;\n };\n\n Module.prototype.findDeps = function (pending) {\n if (this.state !== 'new') {\n return;\n }\n\n this.state = 'pending';\n\n var deps = this.deps;\n\n for (var i = 0; i < deps.length; i++) {\n var dep = deps[i];\n var entry = this.reified[i] = { exports: undefined, module: undefined };\n if (dep === 'exports') {\n this.hasExportsAsDep = true;\n entry.exports = this.module.exports;\n } else if (dep === 'require') {\n entry.exports = this.makeRequire();\n } else if (dep === 'module') {\n entry.exports = this.module;\n } else {\n entry.module = findModule(resolve(dep, this.id), this.id, pending);\n }\n }\n };\n\n Module.prototype.makeRequire = function () {\n var id = this.id;\n var r = function (dep) {\n return require(resolve(dep, id));\n };\n r['default'] = r;\n r.moduleId = id;\n r.has = function (dep) {\n return has(resolve(dep, id));\n };\n return r;\n };\n\n define = function (id, deps, callback) {\n var module = registry[id];\n\n // If a module for this id has already been defined and is in any state\n // other than `new` (meaning it has been or is currently being required),\n // then we return early to avoid redefinition.\n if (module && module.state !== 'new') {\n return;\n }\n\n if (arguments.length < 2) {\n unsupportedModule(arguments.length);\n }\n\n if (!Array.isArray(deps)) {\n callback = deps;\n deps = [];\n }\n\n if (callback instanceof Alias) {\n registry[id] = new Module(callback.id, deps, callback, true);\n } else {\n registry[id] = new Module(id, deps, callback, false);\n }\n };\n\n define.exports = function (name, defaultExport) {\n var module = registry[name];\n\n // If a module for this name has already been defined and is in any state\n // other than `new` (meaning it has been or is currently being required),\n // then we return early to avoid redefinition.\n if (module && module.state !== 'new') {\n return;\n }\n\n module = new Module(name, [], noop, null);\n module.module.exports = defaultExport;\n module.state = 'finalized';\n registry[name] = module;\n\n return module;\n };\n\n function noop() {}\n // we don't support all of AMD\n // define.amd = {};\n\n function Alias(id) {\n this.id = id;\n }\n\n define.alias = function (id, target) {\n if (arguments.length === 2) {\n return define(target, new Alias(id));\n }\n\n return new Alias(id);\n };\n\n function missingModule(id, referrer) {\n throw new Error('Could not find module `' + id + '` imported from `' + referrer + '`');\n }\n\n function findModule(id, referrer, pending) {\n var mod = registry[id] || registry[id + '/index'];\n\n while (mod && mod.isAlias) {\n mod = registry[mod.id] || registry[mod.id + '/index'];\n }\n\n if (!mod) {\n missingModule(id, referrer);\n }\n\n if (pending && mod.state !== 'pending' && mod.state !== 'finalized') {\n mod.findDeps(pending);\n pending.push(mod);\n }\n return mod;\n }\n\n function resolve(child, id) {\n if (child.charAt(0) !== '.') {\n return child;\n }\n\n\n var parts = child.split('/');\n var nameParts = id.split('/');\n var parentBase = nameParts.slice(0, -1);\n\n for (var i = 0, l = parts.length; i < l; i++) {\n var part = parts[i];\n\n if (part === '..') {\n if (parentBase.length === 0) {\n throw new Error('Cannot access parent module of root');\n }\n parentBase.pop();\n } else if (part === '.') {\n continue;\n } else {\n parentBase.push(part);\n }\n }\n\n return parentBase.join('/');\n }\n\n function has(id) {\n return !!(registry[id] || registry[id + '/index']);\n }\n\n requirejs.entries = requirejs._eak_seen = registry;\n requirejs.has = has;\n requirejs.unsee = function (id) {\n findModule(id, '(unsee)', false).unsee();\n };\n\n requirejs.clear = function () {\n requirejs.entries = requirejs._eak_seen = registry = dict();\n seen = dict();\n };\n\n // This code primes the JS engine for good performance by warming the\n // JIT compiler for these functions.\n define('foo', function () {});\n define('foo/bar', [], function () {});\n define('foo/asdf', ['module', 'exports', 'require'], function (module, exports, require) {\n if (require.has('foo/bar')) {\n require('foo/bar');\n }\n });\n define('foo/baz', [], define.alias('foo'));\n define('foo/quz', define.alias('foo'));\n define.alias('foo', 'foo/qux');\n define('foo/bar', ['foo', './quz', './baz', './asdf', './bar', '../foo'], function () {});\n define('foo/main', ['foo/bar'], function () {});\n define.exports('foo/exports', {});\n\n require('foo/exports');\n require('foo/main');\n require.unsee('foo/bar');\n\n requirejs.clear();\n\n if (typeof exports === 'object' && typeof module === 'object' && module.exports) {\n module.exports = { require: require, define: define };\n }\n})(this);","/**\n * DmpConnect-JS JavaScript wrapper.\n * Copyright (c) 2016, icanopee SAS. All right reserved.\n *\n * Version 0.9.9\n */\n\n/** Return a string holding the object properties in HTML.\n *\n * @param {object} o The object to dump.\n * @param {string} shift Offset to apply to the display.\n */\nfunction printObject(o, shift) {\n shift = shift || \"\";\n var defaultSpacing = \" \";\n\n var out = shift + \"{\\n\";\n for (var p in o) {\n var value = o[p];\n\n if (o[p] !== null && typeof o[p] === \"object\")\n // Recursive call to get the object properties\n value = printObject(o[p], shift + defaultSpacing);\n\n out += defaultSpacing + shift + '\"' + p + '\" : ' + value + \"\\n\";\n }\n out += shift + \"}\\n\";\n return out;\n}\n\nconst INITIAL_STATE = {\n session: false,\n PcscReaders: false,\n cpxCard: false,\n DMPenabled: false,\n cpxCardRead: false,\n vitaleCard: false,\n vitaleCardRead: false,\n DmpConnector: false,\n DcParameterRegistered: false\n};\nconst INITIAL_DMP_STATE = {\n certifiedIdentity: false,\n directAuthenticationStatus: false\n};\n\n/*\n Indicate if commands should be sent using WebSocket or using POST method.\n\n @retval 1 If commands should be sent using WebSocket\n @retval 0 If commands should be sent using POST method to the /api entry point.\n\n */\nfunction sendCommandUsingWebSocket() {\n var sendUsingWsBtn = document.getElementById(\"btnSendCommandUsingWebSocket\");\n if (sendUsingWsBtn) {\n return sendUsingWsBtn.checked ? 1 : 0;\n } else {\n // Default to true if button is not present.\n return 1;\n }\n}\n\n/**\n * DMPConnect class.\n *\n * Parameter names conventions\n * Prefix \"s_\": string.\n * Prefix \"i_\": integer.\n * Prefix \"f_\": float.\n *\n * Common input command parameters:\n * \"s_name\" : Command identifier. Mandatory.\n * \"s_sessionId\" : Input parameter that is mandatory for all commands except hl_openSession(). Returned by hl_openSessionWithCustomDcParam().\n *\n * Output parameters:\n * \"s_status\" : Always returned. Can be \"OK\", \"ERROR\" or \"API_ERROR\".\n *\n * If s_status == \"ERROR\" or s_status == \"API_ERROR\"\n * \"s_errorDescription\" : A description of the error.\n *\n * If status == \"API_ERROR\"\n * \"i_apiErrorType\" : See ErrorType in dmp_api_errors.h.\n * \"s_apiErrorTypeDescription\" : It is the a textual description of the error type.\n * \"i_apiErrorCode\" : See ApiErrorCode in dmp_api_errors.h.\n * \"s_apiErrorDescription\" : Description of the error.\n * \"s_apiErrorContext\" : DmpConnect function that raised the error.\n * \"s_apiErrorExtendedInformations\" : More informations about the problem.\n *\n * If s_status == \"OK\" and the command wraps an API function:\n * \"i_returnValue\" : The return value of the original function.\n */\n\n/**\n * Constructor.\n *\n * @param {function} logCallbackFunc Log function to use during methods execution.\n * @param {function} refreshCallbackFunc Function called when the internal object state has been updated.\n * i.e. for example, when the session id has been set after handling hl_openSession\n * or hl_closeSession.\n * @param {function} errorHandler Function called when an error is raised.\n * @param {string} localServerPort Optional. Websockets server port number. Default: \"9982\".\n * @param {string} localServerDomain Websockets server domain name. Eg. \"localhost.icanopee.net\".\n */\nfunction DMPConnect(\n logCallbackFunc,\n refreshCallbackFunc,\n errorHandler,\n initCallback,\n localServerPort,\n localServerDomain\n) {\n // Default value.\n localServerPort = localServerPort || 9982;\n\n this._port = localServerPort;\n this._sessionId = \"\";\n this._logCallback = logCallbackFunc;\n this._refreshCallback = refreshCallbackFunc;\n this._errorHandler = errorHandler;\n this._serverDomain = localServerDomain;\n this._serverPort = localServerPort;\n\n if (localServerDomain) {\n this._serverUrl = \"wss://\" + localServerDomain + \":\" + localServerPort;\n if (initCallback) initCallback(this._serverUrl);\n }\n\n this._state = { ...INITIAL_STATE };\n this._dmpState = { ...INITIAL_DMP_STATE };\n}\n\nDMPConnect.prototype.getState = function () {\n return { ...this._state, dmp: { ...this._dmpState } };\n};\nDMPConnect.prototype.setState = function (key, value) {\n this._state[key] = value;\n};\nDMPConnect.prototype.setDmpState = function (key, value) {\n this._dmpState[key] = value;\n};\nDMPConnect.prototype.resetState = function () {\n this._dmpState = { ...INITIAL_DMP_STATE };\n this._state = { ...INITIAL_STATE };\n};\n\nDMPConnect.prototype.getSessionId = function () {\n return this._sessionId;\n};\n\n/**\n * Send a command to DmpConnect-JS server.\n * If the answer is not received within the given time frame (@see timeoutInSeconds), or if there is a network communication error,\n * the error handler is called.\n *\n * If the answer is received and is correctly formatted, the answer callback is called.\n\n * The callback is given one parameter: an object holding the server answer in its properties.\n *\n * About the commands:\n * DmpConnect-JS expects JSON-formatted input commands.\n * The command is built (JSON.stringify) from the properties of the 'command' object given in parameter.\n * The server answer is also JSON-formatted. It is deserialized into an object (with JSON.parse) that is given to the 'success callback'\n * that should process the answer.\n *\n * @param {object} command Will be serialized to a JSON string to create the command.\n *\n * @param {int} timeoutInSeconds Timeout for the server answer.\n *\n * @param {function} answerCallback The callback that will receive the response from the local server.\n * When the command is sent with a persistent socket (see next parameter), this\n * function is expected to return true or false.\n * If false is returned, the socket is closed. Otherwise the socket remains open.\n *\n * @param {boolean} persistentSocket Set to false by default.\n * If set to true, answerCallback will receive asynchronous messages from the local server and\n * the socket will not be closed after having received the answer. See answerCallback.\n * If set to false, the command is considered synchronous. In this case, the following operations are performed:\n * (1) the command is sent, (2) the answer is received, (3) the socket is closed.\n * @param {function} wrapperCallback DMPConnect inner function for object related handling on command response.\n *\n * @return {object} The websocket object.\n */\nDMPConnect.prototype.sendCommand = function (\n command,\n timeoutInSeconds,\n answerCallback,\n persistentSocket,\n wrapperCallback\n) {\n if (!sendCommandUsingWebSocket()) {\n this.sendPostApiCommand(\n command,\n undefined,\n timeoutInSeconds,\n answerCallback,\n wrapperCallback\n );\n return;\n }\n\n // The case below occur if getDomain() failed or have not yet retreived the domain name, or if an empty string has been given to the contructor.\n if (!this._serverUrl) {\n var error = this.createWrapperError(\n DMPConnect.WrapperErrorCode.InitializationError,\n \"DmpConnect-JS server address is not defined.\"\n );\n return this._errorHandler(error, command, timeoutInSeconds, answerCallback);\n }\n\n if (!window.hasOwnProperty(\"WebSocket\")) {\n // The browser doesn't support WebSocket\n var error = this.createWrapperError(\n DMPConnect.WrapperErrorCode.BrowserNotSupported,\n \"Websocket is not supported by your browser\"\n );\n return this._errorHandler(error, command, timeoutInSeconds, answerCallback);\n }\n\n persistentSocket = persistentSocket || false;\n\n this._logCallback(\"Opening a connection on [\" + this._serverUrl + \"].\");\n\n var ws = new WebSocket(this._serverUrl);\n\n var timer = null;\n\n // Socket opened callback.\n ws.onopen = (function (\n self,\n ws,\n timeoutInSeconds,\n answerCallback,\n persistentSocket,\n wrapperCallback\n ) {\n return function () {\n var message = JSON.stringify(command);\n\n try {\n var forceCloseSocket = (function (\n ws,\n self,\n command,\n timeoutInSeconds,\n answerCallback,\n wrapperCallback\n ) {\n return function () {\n // Close the connection.\n ws.close();\n var error = self.createWrapperError(\n DMPConnect.WrapperErrorCode.ServerTimeout,\n \"Server timeout reached.\"\n );\n if (wrapperCallback) wrapperCallback(error);\n\n return self._errorHandler(\n error,\n command,\n timeoutInSeconds,\n answerCallback\n );\n };\n })(\n ws,\n self,\n command,\n timeoutInSeconds,\n answerCallback,\n wrapperCallback\n );\n\n ws.send(message);\n self._logCallback(\"Message sent [\" + message + \"].\", command);\n // Set a timer for the server answer timeout.\n if (!persistentSocket)\n timer = setTimeout(forceCloseSocket, timeoutInSeconds * 1000);\n } catch (exception) {\n // Close the connection.\n ws.close();\n var error = self.createWrapperError(\n DMPConnect.WrapperErrorCode.SocketError,\n \"Websocket has thrown an unhandled exception.\"\n );\n if (wrapperCallback) wrapperCallback(error);\n return self._errorHandler(error);\n }\n };\n })(\n this,\n ws,\n timeoutInSeconds,\n answerCallback,\n persistentSocket,\n wrapperCallback\n );\n\n // Change the message handler since we expect an answer from the server.\n if (persistentSocket) {\n // Here, we just handled a command that is expected to return multiple answers from time to time,\n // so we don't close the websocket and change its message handling callback to the following.\n ws.onmessage = (function (\n self,\n command,\n timeoutInSeconds,\n answerCallback,\n persistentSocket,\n wrapperCallback\n ) {\n return function (event) {\n self._logCallback(\"Asynchronous data received\\n\");\n self._logCallback(\"Async data:\\n\" + event.data + \"\\n\");\n\n if (event.data.length > 0) {\n var receivedData = JSON.parse(event.data);\n if (wrapperCallback) wrapperCallback(receivedData);\n\n // Directly end the dialog if an error occurred while trying to start the monitoring session.\n if (receivedData.s_status != \"OK\") {\n // Close the connection.\n ws.close();\n return self._errorHandler(\n receivedData,\n command,\n timeoutInSeconds,\n answerCallback,\n persistentSocket\n );\n }\n\n // Call the async callback.\n // The callback is expected to return true or false.\n // - false will close the socket and stop the server from sending notifications.\n // - true indicate that the user still need notifications.\n answerCallback(\n receivedData,\n (function (ws, receivedData, self, answerCallback) {\n return function (keepSending) {\n if (keepSending) {\n self._logCallback(\"-- Async data handled.\");\n } else {\n self._logCallback(\n \"-- Async data handled. Closing the websocket.\"\n );\n ws.close();\n\n // Call the user answer callback.\n answerCallback(receivedData);\n }\n };\n })(ws, receivedData, self, answerCallback)\n );\n }\n };\n })(\n this,\n command,\n timeoutInSeconds,\n answerCallback,\n persistentSocket,\n wrapperCallback\n );\n } else {\n // Non persistent socket: parse the answer, close the socket and call the error handler (if needed) then the user callback.\n ws.onmessage = (function (\n self,\n command,\n timeoutInSeconds,\n answerCallback,\n wrapperCallback\n ) {\n return function (event) {\n var receivedData = JSON.parse(event.data);\n self._logCallback(\"Synchronous answer received.\");\n self._logCallback(\"Answer:\\n\" + event.data + \"\\n\");\n\n // Disable the timeout timer.\n clearTimeout(timer);\n\n // Close the socket.\n ws.close();\n\n if (receivedData.s_status != \"OK\") {\n return self._errorHandler(\n receivedData,\n command,\n timeoutInSeconds,\n answerCallback\n );\n }\n\n if (wrapperCallback) wrapperCallback(receivedData);\n answerCallback(receivedData);\n };\n })(this, command, timeoutInSeconds, answerCallback, wrapperCallback);\n }\n\n ws.onclose = (function (\n self,\n command,\n timeoutInSeconds,\n answerCallback,\n wrapperCallback\n ) {\n return function (event) {\n var code = event.code;\n var reason = event.reason;\n var wasClean = event.wasClean;\n\n if (!reason) {\n // See http://tools.ietf.org/html/rfc6455#section-7.4.1\n if (code == 1000)\n reason =\n \"Normal closure, meaning that the purpose for which the connection was established has been fulfilled.\";\n else if (code == 1001)\n reason =\n 'An endpoint is \"going away\", such as a server going down or a browser having navigated away from a page.';\n else if (code == 1002)\n reason =\n \"An endpoint is terminating the connection due to a protocol error\";\n else if (code == 1003)\n reason =\n \"An endpoint is terminating the connection because it has received a type of data it cannot accept (e.g., an endpoint that understands only text data MAY send this if it receives a binary message).\";\n else if (code == 1004)\n reason =\n \"Reserved. The specific meaning might be defined in the future.\";\n else if (code == 1005) reason = \"No status code was actually present.\";\n else if (code == 1006)\n reason =\n \"The connection was closed abnormally, e.g., without sending or receiving a Close control frame\";\n else if (code == 1007)\n reason =\n \"An endpoint is terminating the connection because it has received data within a message that was not consistent with the type of the message (e.g., non-UTF-8 [http://tools.ietf.org/html/rfc3629] data within a text message).\";\n else if (code == 1008)\n reason =\n 'An endpoint is terminating the connection because it has received a message that \"violates its policy\". This reason is given either if there is no other sutible reason, or if there is a need to hide specific details about the policy.';\n else if (code == 1009)\n reason =\n \"An endpoint is terminating the connection because it has received a message that is too big for it to process.\";\n // Note that this status code is not used by the server, because it can fail the WebSocket handshake instead.\n else if (code == 1010)\n reason =\n \"An endpoint (client) is terminating the connection because it has expected the server to negotiate one or more extension, but the server didn't return them in the response message of the WebSocket handshake. Specifically, the extensions that are needed are: \" +\n event.reason;\n else if (code == 1011)\n reason =\n \"A server is terminating the connection because it encountered an unexpected condition that prevented it from fulfilling the request.\";\n else if (code == 1015)\n reason =\n \"The connection was closed due to a failure to perform a TLS handshake (e.g., the server certificate can't be verified).\";\n else reason = \"Unknown reason\";\n }\n\n // Websocket closed with an error?\n if (code != 1000) {\n var errorDesc =\n \"Connection closed with an error. Status: \" +\n code +\n \". Reason: \" +\n reason +\n \". wasClean: \" +\n wasClean +\n \".\";\n var error = self.createWrapperError(\n DMPConnect.WrapperErrorCode.ConnectionClosedError,\n errorDesc\n );\n\n if (wrapperCallback) wrapperCallback(error);\n return self._errorHandler(\n error,\n command,\n timeoutInSeconds,\n answerCallback\n );\n } else {\n self._logCallback(\"Connection closed.\");\n }\n };\n })(this, command, timeoutInSeconds, answerCallback, wrapperCallback);\n\n ws.onerror = (function (\n self,\n command,\n timeoutInSeconds,\n answerCallback,\n wrapperCallback\n ) {\n return function () {\n var error = self.createWrapperError(\n DMPConnect.WrapperErrorCode.SocketError,\n \"An error occurred on the socket\"\n );\n if (wrapperCallback) wrapperCallback(error);\n return self._errorHandler(\n error,\n command,\n timeoutInSeconds,\n answerCallback\n );\n };\n })(this, command, timeoutInSeconds, answerCallback, wrapperCallback);\n\n return ws;\n};\n\nfunction getXhr() {\n if (window.XMLHttpRequest || window.ActiveXObject) {\n if (window.ActiveXObject) {\n try {\n return new ActiveXObject(\"Msxml2.XMLHTTP\");\n } catch (e) {\n return new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n } else {\n return new XMLHttpRequest();\n }\n } else {\n alert(\"Your browser does not support XMLHTTPRequest\");\n return null;\n }\n}\n\n/**\n * Send a POST request to the /api entry point.\n */\nDMPConnect.prototype.sendPostApiCommand = function (\n aCommandData,\n aCommandName,\n aTimeoutInSecond,\n aCallBackFunction,\n wrapperCallback\n) {\n var xhr = getXhr();\n\n var message = JSON.stringify(aCommandData);\n\n if (aCommandName === undefined) {\n aCommandName = aCommandData.s_commandName.toLowerCase();\n }\n\n var url =\n \"https://\" +\n this._serverDomain +\n \":\" +\n this._serverPort +\n \"/api/\" +\n aCommandName;\n\n console.log(\n \"Sending to '\" + url + \"' the following message '\" + message + \"'.\"\n );\n\n xhr.onreadystatechange = function () {\n if (xhr.readyState == 4) {\n // Complete\n try {\n jsonData = JSON.parse(xhr.responseText);\n console.log(\"POST command answer : \" + JSON.stringify(jsonData));\n\n if (wrapperCallback) wrapperCallback(jsonData);\n\n if (aCallBackFunction) {\n if (jsonData.s_status != \"OK\") {\n aCallBackFunction({ error: jsonData });\n } else {\n aCallBackFunction(jsonData);\n }\n }\n } catch (e) {\n aCallBackFunction({ error: e });\n }\n }\n };\n\n xhr.ontimeout = function () {\n console.error(\"Timeout encountered during transfert\");\n };\n\n xhr.open(\"POST\", url, true);\n xhr.timeout = aTimeoutInSecond * 1000;\n xhr.send(message);\n};\n\n/**\n * Send a POST request to the /entry point\n with Content-Type: application/x-www-form-urlencoded\n return the result of the post in json\n */\nDMPConnect.prototype.sendURLCommand = async function (\n entrypoint,\n param1,\n val1,\n param2,\n val2,\n param3,\n val3,\n param4,\n val4\n) {\n url =\n \"https://\" + this._serverDomain + \":\" + this._serverPort + \"/\" + entrypoint;\n\n let body_val = \"\";\n if (param1 && val1) {\n body_val = param1 + \"=\" + val1;\n if (param2 && val2) {\n body_val = body_val + \"&\" + param2 + \"=\" + val2;\n if (param3 && val3) {\n body_val = body_val + \"&\" + param3 + \"=\" + val3;\n if (param4 && val4) {\n body_val = body_val + \"&\" + param4 + \"=\" + val4;\n }\n }\n }\n }\n\n try {\n const response = await fetch(url, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/x-www-form-urlencoded\",\n Authorization: \"Bearer\"\n },\n body: body_val\n });\n const data = await response.json();\n return data;\n } catch (error) {\n console.error(\"error :\", error);\n return {};\n }\n};\n\nDMPConnect.prototype.sendHttpCommand = function (\n aCommandData,\n anEntryPoint,\n aCallBackFunction\n) {\n var xhr = getXhr();\n var url =\n \"https://\" +\n this._serverDomain +\n \":\" +\n this._serverPort +\n \"/remotecommand/\" +\n anEntryPoint +\n \"\";\n\n var message = JSON.stringify(aCommandData);\n console.log(\n \"Sending to '\" + url + \"' the following message '\" + message + \"'.\"\n );\n\n xhr.onreadystatechange = function () {\n if (xhr.readyState == 4) {\n // Complete\n try {\n jsonData = JSON.parse(xhr.responseText);\n console.log(\"HTTP command answer : \" + JSON.stringify(jsonData));\n\n if (aCallBackFunction) {\n if (jsonData.s_status != \"OK\") {\n aCallBackFunction({ error: jsonData });\n } else {\n aCallBackFunction(jsonData);\n }\n }\n } catch (e) {\n aCallBackFunction({ error: e });\n }\n }\n };\n\n // Send request.\n xhr.open(\"POST\", url, true);\n xhr.send(message);\n};\n\n/**\n * @brief Wrapper and DmpConnect API error types.\n */\nDMPConnect.ErrorType = {\n // DmpConnect API error types.\n ApiErrors: 1,\n DMPErrors: 2,\n CurlErrors: 3,\n VitaleErrors: 4,\n MssErrors: 5,\n TlsiErrors: 6,\n DpErrors: 7,\n\n // JS Wrapper errors.\n WrapperErrors: 5000,\n\n // DmpConnect-JS server software errors.\n DmpConnectJsSoftwareErrors: 6000\n};\n\n/**\n * @brief DMPConnect wrapper related error codes (WrapperErrors)\n */\nDMPConnect.WrapperErrorCode = {\n BrowserNotSupported: 1,\n SocketError: 2,\n ConnectionClosedError: 3,\n UnexpectedResponse: 4,\n ServerTimeout: 5,\n InitializationError: 6\n};\n\n/**\n * @brief Error codes for DmpConnectJsSoftwareErrors error type.\n * It is software errors returned by the WS server.\n */\nDMPConnect.DmpConnectJsErrorCodes = {\n ErrTechnical: 1, // All internal software error (allocations, bugs, etc.).\n ErrFunctional: 2, // Connector not initialized, no reader specified, unknown command, missing parameter, invalid input data (too wide, invalid type, missing, etc.)\n // That kind of errors must be handled during the application development.\n ErrInvalidSession: 3 // Unknown session.\n};\n\n/**\n * Create a wrapper error having the format of errors returned by DmpConnect API.\n * This error object is expected to be handled by the _errorHandler callback.\n\n * @param {number} errorCode\n * @param {string} errorDesc\n * @param {string} errorTypeDescription\n * @param {string} errorContext\n * @param {string} errorExtendedInformations\n */\nDMPConnect.prototype.createWrapperError = function (\n errorCode,\n errorDesc,\n errorTypeDescription,\n errorContext,\n errorExtendedInformations\n) {\n errorTypeDescription = errorTypeDescription || \"\";\n errorContext = errorContext || \"\";\n errorExtendedInformations = errorExtendedInformations || \"\";\n\n return {\n i_apiErrorType: DMPConnect.ErrorType.WrapperErrors, // The other kind of error are returned by DmpConnect API functions.\n i_apiErrorCode: errorCode,\n s_apiErrorDescription: errorDesc,\n s_apiErrorTypeDescription: errorTypeDescription,\n s_apiErrorContext: errorContext,\n s_apiErrorExtendedInformations: errorExtendedInformations\n };\n};\n\n/**\n * If DmpConnect-JS is released with MSS connect, the MssParameters structure can be set in the optionalParameters parameters:\n * MssParameters\n * {\n * s_numHomologation : \"\" , // A string that identify the software that use MSS. it is used for debugging purpose with ASIP, and must contains : name of the company, name of the software. Total length must not exceed 50 characters.\n * s_producerAddress : \"\" , // Address (address + phone number) of the structure of the producer of the attachment. Lines must be separated by the newline \"\\n\" character, ex: \"10, Grand Rue\\n50 170 Mont-Saint-Michel\".\n * s_softwareDetails : \"\" , // Details of the software that is used to generate the MSS messages. Details must includes the name, version and a contact, ex: \"BIOLO version 1.1 (de la société BIOLOLOGIC au 01 58 45 00 00)\"\n * }\n *\n * Optional parameters :\n * i_disableUpdateCheck Disable check of the last version of the product.\n * s_updateCheckChannel Update channel used to get last version (\"prod\", \"dev\", \"beta\").\n *\n\n * Specific JSON output:\n * {\n * \"s_sessionId\" : \"\"\n * \"s_serviceVersion\" : DmpConnect-JS version. Ex.: \"0.9.9\".\n *\n * // Optional Proxy settings that will override the global settings (xml settings), only for this session.\n * \"s_proxyIpOrUrl\" : Proxy server or IP.\n * \"i_proxyPort\" : Proxy port.\n * \"s_proxyLogin\" : Proxy login.\n * \"s_proxyPassword\" : Proxy password.\n *\n * \"s_applicationId\" : Identifier of the target application. Each application Id exists in a single process.\n *\n * The following informations are returned mostly for information purposes.\n *\n *\n * If a proxy is defined (either in the global configuration (dmpconnect-js2.xml) or in the session):\n * \"s_proxyServer\"\n * \"i_proxyPort\"\n * \"s_proxyLogin\"\n * \"s_proxyPass\"\n *\n * If a ntp server is defined:\n * \"s_ntpServer\"\n * \"i_ntpPort\"\n *\n * If i_disableUpdateCheck is not 1:\n * \"s_lastVersionNumber\" Last version number of the product.\n * \"s_lastVersionUpdateLog\" Last version update log.\n * \"s_lastVersionLinkStr\" Last version download link.\n * }\n *\n * @param {number} timeoutInSeconds If no operation on the session occurred within the given delay (in seconds), it is automatically closed.\n * Default value: 1 hour.\n * @param {object} optionalParameters Used to pass additional parameters (proxy).\n * @param {function} resultCallback The callback that take the result from sendCommand\n */\nDMPConnect.prototype.hl_openSession = function (\n timeoutInSeconds,\n optionalParameters,\n resultCallback\n) {\n timeoutInSeconds = timeoutInSeconds || 3600;\n\n var command = {\n s_commandName: \"hl_openSession\",\n i_timeoutInSeconds: timeoutInSeconds\n };\n\n if (optionalParameters !== undefined) {\n for (var paramName in optionalParameters) {\n command[paramName] = optionalParameters[paramName];\n }\n }\n\n return this.sendCommand(\n command,\n 30,\n resultCallback,\n false,\n (function (self) {\n return function (result) {\n if (result.s_status == \"OK\") {\n self._sessionId = result.s_sessionId;\n self.setState(\"session\", true);\n self._refreshCallback();\n }\n };\n })(this)\n );\n};\n\n// IN\n// {\n// (*) i_forceNtpSync\n// }\n// OUT\n// {\n// f_timeSynchronizationDifference\n// }\nDMPConnect.prototype.hl_getTimeSynchronizationDifference = function (\n resultCallback\n) {\n var command = {\n s_commandName: \"hl_getTimeSynchronizationDifference\",\n i_forceNtpSync: 1 /* Optional */\n };\n\n return this.sendCommand(\n command,\n 30,\n resultCallback,\n false,\n (function (self) {\n return function (result) {\n {\n self._refreshCallback();\n }\n };\n })(this)\n );\n};\n\n/**\n * @brief For debugging purpose only.\n * Force a segfault inside the server.\n */\nDMPConnect.prototype.hl_crash = function () {\n var command = {\n s_commandName: \"hl_crash\"\n };\n\n return this.sendCommand(\n command,\n 30,\n undefined,\n false,\n (function (self) {\n return function (result) {\n self._refreshCallback();\n };\n })(this)\n );\n};\n\n/**\n * @brief For debugging purpose only.\n * Force a child process to be a zombie.\n */\nDMPConnect.prototype.hl_zombie = function () {\n var command = {\n s_commandName: \"hl_zombie\",\n s_sessionId: this.getSessionId()\n };\n\n return this.sendCommand(command, 2, undefined);\n};\n\n/**\n * @brief Send a request to the connector.\n *\n * @param requestBodyJson Request body to send to the connector.\n * @param timeout Timeout of the request.\n *\n */\nDMPConnect.prototype.sendRequest = function (\n requestBodyJson,\n timeout,\n resultCallback\n) {\n var command = requestBodyJson;\n command.s_sessionId = this.getSessionId();\n\n return this.sendCommand(command, timeout, resultCallback);\n};\n\n/**\n * Generate a new unique identifier.\n *\n * IN\n * {\n * i_type Type of unique Identifier :\n * 1 : GUID ex: {87C621C2-A245-4AE5-9C5D-FD3F2877AC55}\n * 2 : UUID ex: \"87c621c2-a245-4ae5-9c5d-fd3f2877ac55\" (canonical UUID)\n * 3 : OID ex: \"2.25.210091339143779326641979668062571519317\"\n * }\n * OUT\n * {\n * s_uniqueId Unique ID.\n * }\n */\nDMPConnect.prototype.hl_generateUniqueId = function (\n anUniqueIdType,\n resultCallback\n) {\n var command = {\n s_commandName: \"hl_generateUniqueId\",\n i_type: anUniqueIdType,\n s_sessionId: this.getSessionId()\n };\n\n return this.sendCommand(command, 2, resultCallback);\n};\n\n/**\n * @brief Same as hl_openSession but use a custom dcparameter\n */\nDMPConnect.prototype.hl_openSessionWithCustomDcParam = function (\n aDcParameter,\n timeoutInSeconds,\n optionalParameters,\n resultCallback\n) {\n timeoutInSeconds = timeoutInSeconds || 3600;\n\n var command = {\n s_commandName: \"hl_openSession\",\n i_timeoutInSeconds: timeoutInSeconds,\n s_dcparameters64: aDcParameter\n };\n\n // Proxy\n if (optionalParameters !== undefined) {\n for (var paramName in optionalParameters) {\n command[paramName] = optionalParameters[paramName];\n }\n }\n\n return this.sendCommand(\n command,\n 30,\n resultCallback,\n false,\n (function (self) {\n return function (result) {\n if (result.s_status == \"OK\") {\n self._sessionId = result.s_sessionId;\n self.setState(\"session\", true);\n self._refreshCallback();\n }\n };\n })(this)\n );\n};\n\n/**\n * This function will issue a message every seconds until the socket or the session is closed.\n * For development/tuning.\n *\n * IN\n * OUT\n * \"sMessage\" : \"Test\" : Always return this.\n */\nDMPConnect.prototype.hl_startDummyMonitoring = function (resultCallback) {\n var command = {\n s_commandName: \"hl_startDummyMonitoring\",\n s_sessionId: this.getSessionId()\n };\n\n return this.sendCommand(command, 2, resultCallback, true);\n};\n\n/**\n * This functions initiate the monitoring of the \"current CPx card\", that should have been set first\n * with a call to hl_getCpxCard().\n * After the standard aknowledgement answer, a first asynchronous event is always sent: it holds the current status\n * of the CPx card.\n * After this, the smartcard reader is checked every \"i_checkingInterval\" seconds for a status change.\n * If the status did not change, nothing is sent.\n *\n * To stop monitoring, simply close the websocket.\n *\n * The status is returned as an integer (i_cardStatus) and also as a string (s_cardStatus).\n *\n * IN\n * \"i_checkingInterval\" : CPx card checking interval in seconds.\n * OUT\n * \"i_cardStatus\" : 0..7\n * \"s_cardStatus\" : Textual description of the status. See below.\n *\n * i_cardStatus: s_cardStatus\n * 0: NotInitialized Should not happen.\n * 1: ValidCardInserted A valid (not expired) CPx card is inserted.\n * 2: NoCardInserted The smartcard reader did not found a card.\n * 3: UnknownCardInserted The card in the smartcard reader is not a CPx.\n * 4: CardStatusChanged Card status has changed since the last access: the card has been removed, or has been changed. Please recreate a new CPx object.\n * 5: CardIsBlocked Too many pin code errors.\n * 6: CardIsExpired The validity end date of the card is above the current date.\n * 7: CpxReaderError All possible errors: galss, missing reader, invalid setup, etc.\n * Other: InvalidStatus Should not happen.\n */\nDMPConnect.prototype.hl_startCpxCardMonitoring = function (\n checkingIntervalInSeconds,\n resultCallback\n) {\n var command = {\n s_commandName: \"hl_startCpxCardMonitoring\",\n i_checkingInterval: checkingIntervalInSeconds,\n s_sessionId: this.getSessionId()\n };\n\n return this.sendCommand(command, 15, resultCallback, true);\n};\n\n/**\n * This functions initiate the monitoring of the \"current Vitale card\", that should have been set first\n * with a call to hl_getVitaleCard().\n * After the standard aknowledgement answer, a first asynchronous event is always sent: it holds the current status\n * of the Vitale card.\n * After this, the smartcard reader is checked every \"i_checkingInterval\" seconds for a status change.\n * If the status did not change, nothing is sent.\n *\n * To stop monitoring, simply close the websocket.\n *\n * The status is returned as an integer (i_cardStatus) and also as a string (s_cardStatus).\n *\n * IN\n * \"i_checkingInterval\" : CPx card checking interval in seconds.\n * OUT\n * \"i_cardStatus\" : See below.\n * \"s_cardStatus\" : Textual description of the status. See below.\n * If a new Vitale card is inserted:\n * \"i_vitaleVersion\" (+ \"s_vitaleVersion\") :\n * 1 : Vital 1 IGEA\n * 2 : Vital 1 SCOT\n * 3 : Vital 2\n * \"i_cardNature\" (+ \"s_cardNature\") :\n * 1 : Real card\n * 2 : Demo card\n * 3 : Test card\n *\n * i_cardStatus & s_cardStatus\n * 0: NotInitialized Should not happen.\n * 1: ReadError A read error occurred: faulty , invalid, saturated, unknown, silent, read error...\n * 2: NewCardFound The Vitale card has changed since the last check.\n * (3: CardFound) Never returned. A valid (not expired) Vitale card is inserted.\n * 4: CardMissing Not card inserted in the smartcard reader.\n * 5: UnknownCard A card is inserted but not a Vitale card.\n * Other: InvalidStatus Should not happen.\n */\nDMPConnect.prototype.hl_startVitaleCardMonitoring = function (\n checkingIntervalInSeconds,\n resultCallback\n) {\n var command = {\n s_commandName: \"hl_startVitaleCardMonitoring\",\n i_checkingInterval: checkingIntervalInSeconds,\n s_sessionId: this.getSessionId()\n };\n\n return this.sendCommand(command, 15, resultCallback, true);\n};\n\n/**\n * @brief Start remote control system.\n * @note This must be initialized once per application. (@note: application is defined by the parameter s_applicationId of the hl_openSession command).\n *\n * IN\n * {\n *\n * }\n * OUT\n * {\n * i_remoteInTcpPort : The port of the TCP socket where remote IN commands can be sent to.\n * i_remoteOutTcpPort : The port of the TCP socket whete remote OUT answers are sent to.\n * s_remoteInDirectory : The directory where remote IN commands can be sent to.\n * s_remoteOutDirectory : The directory where remote OUT answers are sent to.\n * }\n *\n * @note remote control cannot be started twice, use hl_remoteControlStatus to check status of the remote control system.\n */\nDMPConnect.prototype.hl_startRemoteControl = function (\n command,\n resultCallback\n) {\n command = command || {};\n command.s_commandName = \"hl_startRemoteControl\";\n command.s_sessionId = this.getSessionId();\n\n return this.sendCommand(command, 30, resultCallback);\n};\n\n/**\n * @brief Stop the remote control system.\n * @note When stopped, no more commands can be received from remote IN and no answers are sent to remote OUT\n * IN\n * {\n *\n * }\n * OUT\n * {\n * i_running : Current status of the remote control system. 1 : running, 0: stopped.\n *\n * (*) i_remoteInTcpPort : The port of the TCP socket where remote IN commands can be sent to.\n * (*) i_remoteOutTcpPort : The port of the TCP socket whete remote OUT answers are sent to.\n * (*) s_remoteInDirectory : The directory where remote IN commands can be sent to.\n * (*) s_remoteOutDirectory: The directory where remote OUT answers are sent to.\n * }\n *\n * (*) This field is available only if i_running is 1.\n *\n * @note remote control cannot be stopped twice, use hl_remoteControlStatus to check status of the remote control system.\n */\nDMPConnect.prototype.hl_stopRemoteControl = function (command, resultCallback) {\n command = command || {};\n command.s_commandName = \"hl_stopRemoteControl\";\n command.s_sessionId = this.getSessionId();\n\n return this.sendCommand(command, 5, resultCallback);\n};\n\n/**\n * @brief Get status of the remote control system.\n *\n * IN\n * {\n *\n * }\n * OUT\n * {\n *\n * }\n */\nDMPConnect.prototype.hl_remoteControlStatus = function (\n command,\n resultCallback\n) {\n command = command || {};\n command.s_commandName = \"hl_remoteControlStatus\";\n command.s_sessionId = this.getSessionId();\n\n return this.sendCommand(command, 5, resultCallback);\n};\n\n/**\n * @brief Start Remote Control IN monitoring.\n * Each command that is send to server is returned as a json string through the websocket.\n *\n */\nDMPConnect.prototype.hl_startRemoteControlInMonitoring = function (\n resultCallback\n) {\n var command = {\n s_commandName: \"hl_startRemoteControlInMonitoring\",\n s_sessionId: this.getSessionId()\n };\n\n return this.sendCommand(command, 15, resultCallback, true);\n};\n\n/**\n * @brief Send remote answer to JS (then back to the remote channel).\n *\n * @param answerObject Answer object (as defined by the user).\n * @param resultCallback Result callback.\n */\nDMPConnect.prototype.hl_sendRemoteInAnswer = function (\n answerObject,\n resultCallback\n) {\n var command = {\n s_commandName: \"hl_sendRemoteInAnswer\",\n s_sessionId: this.getSessionId()\n };\n command = Object.assign(command, answerObject);\n\n return this.sendCommand(command, 15, resultCallback);\n};\n\n/**\n * @brief Export a document to the remote out directory/TCP\n *\n * IN\n * {\n * i_documentHandle\n * }\n * OUT\n * {\n *\n * }\n */\nDMPConnect.prototype.hl_exportDocumentToRemoteOut = function (\n aDocumentHandle,\n resultCallback\n) {\n var command = {\n s_commandName: \"hl_exportDocumentToRemoteOut\",\n s_sessionId: this.getSessionId(),\n i_documentHandle: aDocumentHandle\n };\n\n return this.sendCommand(command, 30, resultCallback, true);\n};\n\n/**\n * @brief Export a document to the remote out directory/TCP\n *\n * IN\n * {\n * s_ins\n * s_documentUniqueId\n * s_documentUuid // (Optional)\n * }\n * OUT\n * {\n *\n * }\n */\nDMPConnect.prototype.hl_exportDocumentToRemoteOutByUniqueId = function (\n anIns,\n aDocumentUniqueId,\n aDocumentUuid,\n resultCallback\n) {\n var command = {\n s_ins: anIns,\n s_documentUniqueId: aDocumentUniqueId,\n s_documentUuid: aDocumentUuid,\n\n s_commandName: \"hl_exportDocumentToRemoteOutByUniqueId\",\n s_sessionId: this.getSessionId()\n };\n\n return this.sendCommand(command, 60, resultCallback, true);\n};\n\n/**\n * @brief Export a document to XML using same format as hl_exportDocumentToRemoteOut\n *\n * IN\n * {\n * i_documentHandle\n * }\n * OUT\n * {\n *\n * }\n */\nDMPConnect.prototype.hl_exportDocumentToXml = function (\n aDocumentHandle,\n resultCallback\n) {\n var command = {\n s_commandName: \"hl_exportDocumentToXml\",\n s_sessionId: this.getSessionId(),\n i_documentHandle: aDocumentHandle\n };\n\n return this.sendCommand(command, 30, resultCallback, true);\n};\n\n/**\n * @brief Export a document to XML using same format as hl_exportDocumentToRemoteOut\n *\n * IN\n * {\n * s_ins\n * s_documentUniqueId\n * s_documentUuid // (Optional)\n * }\n * OUT\n * {\n *\n * }\n */\nDMPConnect.prototype.hl_exportDocumentToXmlByUniqueId = function (\n anIns,\n aDocumentUniqueId,\n aDocumentUuid,\n resultCallback\n) {\n var command = {\n s_ins: anIns,\n s_documentUniqueId: aDocumentUniqueId,\n s_documentUuid: aDocumentUuid,\n\n s_commandName: \"hl_exportDocumentToXmlByUniqueId\",\n s_sessionId: this.getSessionId()\n };\n\n return this.sendCommand(command, 60, resultCallback, true);\n};\n\n/**\n * @brief Export a notification to remote out directory/TCP\n * Notification indicates that HP is connected.\n *\n * IN\n * {\n *\n * }\n * OUT\n * {\n *\n * }\n */\nDMPConnect.prototype.hl_notifyPsConnectedToRemoteOut = function (\n resultCallback\n) {\n var command = {\n s_commandName: \"hl_notifyPsConnectedToRemoteOut\",\n s_sessionId: this.getSessionId()\n };\n\n return this.sendCommand(command, 30, resultCallback, true);\n};\n\n/**\n * @brief Export a notification to remote out directory/TCP\n * Notification indicates that HP is disconnected.\n */\nDMPConnect.prototype.hl_notifyPsLoggedOutToRemoteOut = function (\n resultCallback\n) {\n var command = {\n s_commandName: \"hl_notifyPsLoggedOutToRemoteOut\",\n s_sessionId: this.getSessionId()\n };\n\n return this.sendCommand(command, 30, resultCallback, true);\n};\n\n/**\n * @brief Export a notification to remote out directory/TCP\n * Notification is custom (defined in the s_status command).\n *\n */\nDMPConnect.prototype.hl_notifyPsConnectionToRemoteOut = function (\n connectionStatus,\n resultCallback\n) {\n var command = {\n s_commandName: \"hl_notifyPsConnectionToRemoteOut\",\n s_sessionId: this.getSessionId(),\n\n s_status: connectionStatus\n };\n\n return this.sendCommand(command, 30, resultCallback, true);\n};\n\nDMPConnect.prototype.hl_sendRemoteOutMessage = function (\n message,\n resultCallback\n) {\n var command = {\n s_commandName: \"hl_sendRemoteOutMessage\",\n s_sessionId: this.getSessionId(),\n\n Message: message\n };\n\n return this.sendCommand(command, 30, resultCallback, true);\n};\n\n/**\n * Get information about remote control for all slaves that matches the given Dcparameters\n */\nDMPConnect.prototype.hl_sessionRemoteControlStatus = function (\n aDcparam,\n resultCallback\n) {\n var command = {\n s_commandName: \"hl_sessionRemoteControlStatus\",\n s_dcparameters64: aDcparam\n };\n return this.sendCommand(command, 30, resultCallback);\n};\n\n/**\n * Get information about remote control or slave that runs using the given TseCredentials.\n */\nDMPConnect.prototype.hl_getTseRemoteControlStatus = function (\n aTseCredential,\n resultCallback\n) {\n var command = {\n s_commandName: \"hl_getTseRemoteControlStatus\",\n s_tseCredentials: aTseCredential\n };\n\n return this.sendCommand(command, 30, resultCallback);\n};\n\n/**\n * @brief This function initiate the Virtual printer monitoring.\n *\n * To stop monitoring, simply close the websocket.\n *\n *\n * After each add of a document, the set of all pending documents is returned as an array of VirtualPrinterDocuments.\n *\n * OUT\n * {\n * VirtualPrinterDocuments :\n * [\n * {\n * \"s_id\" : \"\" ,\n * \"i_fileSize\" : \"\",\n * \"s_fileName\" : \"\",\n * \"s_contentInBase64\" : \"\"\n * }\n * ]\n * }\n *\n * @note if no document is available, the structure is empty.\n */\nDMPConnect.prototype.hl_startPrintedDocumentsMonitoring = function (\n resultCallback\n) {\n var command = {\n s_commandName: \"hl_startPrintedDocumentsMonitoring\",\n s_sessionId: this.getSessionId()\n };\n\n return this.sendCommand(command, 15, resultCallback, true);\n};\n\n/**\n * @brief Remove all pending documents.\n *\n * @param documentsIds (Optional) A set of document ids to remove.\n */\nDMPConnect.prototype.hl_flushPrintedDocuments = function (\n documentsIds,\n resultCallback\n) {\n var command = {\n s_commandName: \"hl_flushPrintedDocuments\",\n s_sessionId: this.getSessionId()\n };\n\n if (documentsIds != undefined) {\n command.s_documentIds = documentsIds;\n }\n\n return this.sendCommand(command, 15, resultCallback);\n};\n\n/**\n * @brief Get number of pending documents in the virtual printer directory\n *\n * IN\n * {\n * }\n * OUT\n * {\n * \"i_count\" : \"\"\n * }\n */\nDMPConnect.prototype.hl_getPrintedDocumentsCount = function (resultCallback) {\n var command = {\n s_commandName: \"hl_getPrintedDocumentsCount\",\n s_sessionId: this.getSessionId()\n };\n\n return this.sendCommand(command, 15, resultCallback);\n};\n\n/**\n * @brief Get current list of printed documents\n *\n * OUT\n * {\n * VirtualPrinterDocuments :\n * [\n * {\n * \"s_id\" : \"\" ,\n * \"i_fileSize\" : \"\",\n * \"s_fileName\" : \"\",\n * \"s_contentInBase64\" : \"\"\n * }\n * ]\n * }\n */\nDMPConnect.prototype.hl_getPrintedDocuments = function (resultCallback) {\n var command = {\n s_commandName: \"hl_getPrintedDocuments\",\n s_sessionId: this.getSessionId()\n };\n\n return this.sendCommand(command, 15, resultCallback);\n};\n\n/**\n * @brief Get next document from the Printed document list and remove it from the list.\n *\n * IN\n * OUT\n * {\n * PrintedDocument\n * {\n * s_contentInBase64 : \"\" // Content of the document in base64\n * s_fileName : \"\" // Document name (without extension)\n * i_fileSize : \"\" // Size of the document (size corresponds to the unencoded document)\n * s_id : \"\" // Internal identifier of the document.\n * },\n * i_remainingDocumentCount : \"\" // Number of remaining document in the list (after removing the returned document).\n * }\n *\n * Note: if no document is available, the structure PrintedDocument is not returned and i_remainingDocumentCount equals 0.\n */\nDMPConnect.prototype.hl_getNextPrintedDocument = function (resultCallback) {\n var command = {\n s_commandName: \"hl_getNextPrintedDocument\",\n s_sessionId: this.getSessionId()\n };\n\n return this.sendCommand(command, 30, resultCallback);\n};\n\nDMPConnect.prototype.hl_closeSession = function (resultCallback) {\n var command = {\n s_commandName: \"hl_closeSession\",\n s_sessionId: this.getSessionId()\n };\n\n return this.sendCommand(\n command,\n 20,\n resultCallback,\n false,\n (function (self) {\n return function (result) {\n if (result.s_status == \"OK\") {\n self._sessionId = \"\";\n self.resetState();\n self._refreshCallback();\n }\n };\n })(this)\n );\n};\n\n/**\n * @brief Returned by hl_getPcscReaders.\n */\nDMPConnect.ReaderSlotType = {\n // 0 = invalid / uninitialized value.\n ST_NO_CARD: 1,\n ST_VITALE_CARD: 2,\n ST_CPS_CARD: 3,\n ST_OTHER: 4,\n ST_UNKNOWN: 5\n};\n\n/**\n * @brief Returned by hl_getPcscReaders.\n */\nDMPConnect.ReaderAccessMode = {\n // 0 = invalid / uninitialized value.\n AM_FULL_PCSC: 1, // PC/SC reader\n AM_GALSS_PCSC: 2, // PC/SC reader relying on the GALSS server\n AM_GALSS_TL: 3, // \"Terminal Lecteur\" reader.\n AM_GALSS_RAC: 4 // \"Referentiel Acces Cartes\"-based reader.\n};\n\n/**\n * Specific JSON output (example):\n * {\n * \"Readers\": [\n * {\n * \"i_accessMode\": 1,\n * \"i_slotType\": 3,\n * \"s_accessMode\": \"Full PC/SC\",\n * \"s_name\": \"SCM Microsystems Inc. SCR33x USB Smart Card Reader 1\",\n * \"s_slotType\": \"CPS card\"\n * },\n * {\n * \"i_accessMode\": 1,\n * \"i_slotType\": 2,\n * \"s_accessMode\": \"Full PC/SC\",\n * \"s_name\": \"SCM Microsystems Inc. SCR35xx USB Smart Card Reader 0\",\n * \"s_slotType\": \"Vitale card\"\n * },\n * {\n * \"i_accessMode\": 2,\n * \"i_slotType\": 3,\n * \"s_accessMode\": \"GALSS/PCSC\",\n * \"s_name\": \"PSS Reader on CPS\",\n * \"s_slotType\": \"CPS card\"\n * },\n * {\n * \"i_accessMode\": 2,\n * \"i_slotType\": 2,\n * \"s_accessMode\": \"GALSS/PCSC\",\n * \"s_name\": \"Vitale\",\n * \"s_slotType\": \"Vitale card\"\n * },\n * {\n * \"i_accessMode\": 2,\n * \"i_slotType\": 2,\n * \"s_accessMode\": \"GALSS/PCSC\",\n * \"s_name\": \"Log_SV\",\n * \"s_slotType\": \"Vitale card\"\n * }\n * ],\n * \"s_status\": \"OK\"\n * }\n */\nDMPConnect.prototype.hl_getPcscReaders = function (resultCallback) {\n var command = {\n s_commandName: \"hl_getPcscReaders\",\n s_sessionId: this.getSessionId()\n };\n\n return this.sendCommand(\n command,\n 15,\n resultCallback,\n false,\n (function (self) {\n return function (result) {\n if (result.s_status == \"OK\") {\n self.setState(\"PcscReaders\", true);\n self._refreshCallback();\n }\n };\n })(this)\n );\n};\n\n/**\n * @param {number} readerNumber Indice of the reader in the list returned by hl_getPcscReaders().\n * @param {string} readerName Optional. PC/SC reader name (e.g. \"Gemalto USB Smart Card Reader 0\"),\n * or a GALSS LAD name (e.g \"CPS\"). See DmpConnect specs for explanations.\n * If it is set, 'readerNumber' is ignored.\n * @param {function} resultCallback The callback that take the result from sendCommand\n */\nDMPConnect.prototype.hl_getCpxCard = function (\n readerNumber,\n readerName,\n resultCallback\n) {\n var command = {\n s_commandName: \"hl_getCpxCard\",\n\n s_sessionId: this.getSessionId()\n };\n\n if (readerName) {\n if (readerName != \"\") {\n command.s_readerName = readerName;\n }\n }\n if (readerNumber) {\n if (readerNumber > 0) {\n command.i_readerNumber = readerNumber;\n }\n } else {\n command.i_readerNumber = 0;\n }\n\n return this.sendCommand(\n command,\n 30,\n resultCallback,\n false,\n (function (self) {\n return function (result) {\n if (result.s_status == \"OK\") {\n self.setState(\"cpxCard\", true);\n self.setState(\"DMPenabled\", true);\n self._refreshCallback();\n }\n };\n })(this)\n );\n};\n\n/**\n * @brief Update access token for the wireless CPx connection.\n *\n * IN\n * {\n * s_authenticationToken New token.\n * }\n * OUT\n * {\n *\n * }\n */\nDMPConnect.prototype.hl_updateCpxAuthenticationToken = function (\n authToken,\n resultCallback\n) {\n var command = {};\n command.s_sessionId = this.getSessionId();\n command.s_authenticationToken = authToken;\n command.s_commandName = \"hl_updateCpxAuthenticationToken\";\n\n return this.sendCommand(command, 10, resultCallback);\n};\n\nDMPConnect.prototype.hl_getCpxHpInfos = function (resultCallback) {\n var command = {\n s_commandName: \"hl_getCpxHpInfos\",\n s_sessionId: this.getSessionId()\n };\n\n return this.sendCommand(command, 5, resultCallback);\n};\n\n/**\n * @param {number} readerNumber Indice of the reader in the list returned by hl_getPcscReaders().\n * @param {string} readerName Optional. PC/SC reader name (e.g. \"SCM Microsystems Inc. SCR331-DI Smart Card Reader 0\"),\n * or a GALSS LAD name (e.g \"Vitale\"). See DmpConnect specs for explanations.\n * If it is set, 'readerNumber' is ignored.\n * @param {function} resultCallback The callback that take the result from sendCommand\n */\nDMPConnect.prototype.hl_getVitaleCard = function (\n readerNumber,\n readerName,\n resultCallback\n) {\n var command = {\n s_commandName: \"hl_getVitaleCard\",\n s_sessionId: this.getSessionId()\n };\n\n if (readerName) {\n if (readerName != \"\") {\n command.s_readerName = readerName;\n }\n }\n if (readerNumber) {\n if (readerNumber > 0) {\n command.i_readerNumber = readerNumber;\n }\n } else {\n command.i_readerNumber = 0;\n }\n\n return this.sendCommand(\n command,\n 10,\n resultCallback,\n false,\n (function (self) {\n return function (result) {\n if (result.s_status == \"OK\") {\n self.setState(\"vitaleCard\", true);\n self._refreshCallback();\n }\n };\n })(this)\n );\n};\n\n/**\n * @brief Update access token for the wireless Vitale connection.\n *\n * IN\n * {\n * s_authenticationToken New token.\n * }\n * OUT\n * {\n *\n * }\n */\nDMPConnect.prototype.hl_updateVitaleAuthenticationToken = function (\n authToken,\n resultCallback\n) {\n var command = {};\n command.s_sessionId = this.getSessionId();\n command.s_authenticationToken = authToken;\n command.s_commandName = \"hl_updateVitaleAuthenticationToken\";\n\n return this.sendCommand(command, 10, resultCallback);\n};\n\n/**\n * hl_getCpxCard must have been called first.\n *\n * IN\n * {\n * \"i_digestType\" 0: SHA-1 ; 1: SHA-256 ; 2: SHA-512\n * \"s_stringToSign\"\n * }\n *\n *\n * Specific JSON output:\n * {\n * \"s_signature\" : \"\",\n * \"s_signatureCertificate\" : \"\"\n * \"s_digest\" : \"\"\n * }\n *\n * @param {string} pinCode E.g. \"1234\" for all test cards by default.\n * @param {string} data Data to sign.\n * @param {function} resultCallback The callback that take the result from sendCommand\n */\nDMPConnect.prototype.hl_signWithCpxCard = function (\n pinCode,\n data,\n resultCallback\n) {\n var command = {\n s_commandName: \"hl_signWithCpxCard\",\n s_pinCode: pinCode,\n s_stringToSign: data,\n i_digestType: 1,\n s_sessionId: this.getSessionId()\n };\n\n return this.sendCommand(command, 10, resultCallback);\n};\n\n/**\n * hl_getCpxCard must have been called first.\n *\n * IN :\n * s_pinCode\n * i_returnCertificates (*)\n *\n * Specific JSON output.\n * Example:\n * {\n * \"PracticeLocations\": [\n * {\n * \"s_practiceLocationActivity\": \"SA07\",\n * \"s_practiceLocationHealthcareSettings\": \"SA07\",\n * \"s_practiceLocationName\": \"CABINET DR GENE\",\n * \"s_practiceLocationBillingNumber\" : \"2000400012\",\n * \"s_practiceLocationStructureId\" : \"499700240007002\"\n * }\n * ],\n * \"i_remainingPinCodeInputs\": 3,\n * \"s_given\": \"ALAIN\",\n * \"s_internalId\": \"899900023351\",\n * \"s_name\": \"GENE RPPS\",\n * \"s_profession\": \"10\",\n * \"s_professionOid\": \"1.2.250.1.71.1.2.7\",\n * \"s_professionDescription\" : \"Médecin\",\n * \"s_speciality\": \"SM26\",\n * \"s_specialityDescription\" : \"Qualifié en médecine générale (SM)\",\n * \"s_status\": \"OK\"\n * }\n * @param {string} pinCode E.g. \"1234\" for all test cards by default.\n * @param {function} resultCallback The callback that take the result from sendCommand\n */\nDMPConnect.prototype.hl_readCpxCard = function (pinCode, resultCallback) {\n var command = {\n s_commandName: \"hl_readCpxCard\",\n i_returnCertificates: 1, // Note: this is optional.\n s_sessionId: this.getSessionId()\n };\n\n if (pinCode.length == 4) {\n command.s_pinCode = pinCode;\n }\n if (pinCode.length > 4) {\n command.s_authenticationToken = pinCode;\n }\n\n return this.sendCommand(\n command,\n 120,\n resultCallback,\n false,\n (function (self) {\n return function (result) {\n if (result.s_status == \"OK\") {\n self.setState(\"cpxCardRead\", true);\n self._refreshCallback();\n }\n };\n })(this)\n );\n};\n\n/**\n * @brief Check CPx token status.\n *\n * @note CPx card must be set before. (ie: call to hl_getCpxCard).\n *\n * IN\n * {\n *\n * }\n * OUT\n * {\n * i_previousCardStatus (If available)\n * s_previousCardStatus (If available)\n * i_cardStatus\n * s_cardStatus\n *\n * }\n */\nDMPConnect.prototype.hl_checkCpxTokenStatus = function (\n optionalParams,\n resultCallback\n) {\n var command = {\n s_commandName: \"hl_checkCpxTokenStatus\",\n s_sessionId: this.getSessionId()\n };\n\n return this.sendCommand(command, 10, resultCallback);\n};\n\n/**\n * @brief Check Vitale token status.\n *\n * @note Vitale card must be set before. (ie: call to hl_getVitaleCard).\n *\n * IN\n * {\n *\n * }\n * OUT\n * {\n * i_previousCardStatus (If available)\n * s_previousCardStatus (If available)\n * i_cardStatus\n * s_cardStatus\n * }\n */\nDMPConnect.prototype.hl_checkVitaleTokenStatus = function (\n optionalParams,\n resultCallback\n) {\n var command = {\n s_commandName: \"hl_checkVitaleTokenStatus\",\n s_sessionId: this.getSessionId()\n };\n\n return this.sendCommand(command, 10, resultCallback);\n};\n\n/**\n * @brief Get the status of the inserted CPx card.\n *\n * @note hl_getCpxCard must have been called first.\n *\n * OUT\n * {\n * i_nbInputLeft : Number of remaining PIN code inputs.\n * s_validityDate : Card expiration date.\n * s_cardId : Serial number of the card.\n * i_cardStatus : CPx status. @see DmpConnect.CpxCardStatus enum for values.\n * }\n */\nDMPConnect.prototype.hl_getCpxStatus = function (resultCallback) {\n var command = {\n s_commandName: \"hl_getCpxStatus\",\n s_sessionId: this.getSessionId()\n };\n\n return this.sendCommand(command, 30, resultCallback);\n};\n\n/**\n * @brief Check if license of the current CPx user is valid to use this product.\n *\n * IN\n * {\n * }\n * OUT\n * {\n * }\n *\n * @note If licence is valid, this function simply returns OK, if not an error is generated and\n * the detail associated in the answer could be checked to know why license check failed.\n */\nDMPConnect.prototype.hl_checkUserLicenseRight = function (resultCallback) {\n var command = {\n s_commandName: \"hl_checkUserLicenseRight\",\n s_sessionId: this.getSessionId()\n };\n\n return this.sendCommand(command, 10, resultCallback);\n};\n\nDMPConnect.VitaleStatus = {\n ApiError: 0, // API error.\n MissingCard: 1, // Card is missing.\n Error: 2, // Error: invalid faulty, invalid, saturated, unknown, silent, read error, etc.\n ProdCard: 3, // Card found. Real valid card.\n TestCard: 4, // Card found. Test card.\n DemoCard: 5 // Card found. Demo card.\n};\n\n/**\n * hl_getVitaleCard must have been called.\n *\n * Specific JSON output:\n * {\n * \"Patients\": [\n * {\n * \"s_birthday\": \"601020\",\n * \"s_birthname\": \"\",\n * \"s_certifiedNir\": \"\",\n * \"s_given\": \"IGOR\",\n * \"s_ins\": \"1793908334471761438991\",\n * \"s_name\": \"AATIUN\",\n * \"s_nir\": \"1601063220118 03\"\n * },\n * {\n * \"s_birthday\": \"650930\",\n * \"s_birthname\": \"\",\n * \"s_certifiedNir\": \"\",\n * \"s_given\": \"CECILE\",\n * \"s_ins\": \"\",\n * \"s_name\": \"AATIUN\",\n * \"s_nir\": \"1601063220118 03\"\n * },\n * {\n * \"s_birthday\": \"951210\",\n * \"s_birthname\": \"\",\n * \"s_certifiedNir\": \"\",\n * \"s_given\": \"SERGE\",\n * \"s_ins\": \"\",\n * \"s_name\": \"AATIUN\",\n * \"s_nir\": \"1601063220118 03\"\n * }\n * ],\n * \"i_cardStatus\": 5, // See VitaleStatus enum.\n * \"s_cardStatusText\": \"Card found. Demo card.\",\n * \"s_status\": \"OK\"\n * }\n */\nDMPConnect.prototype.hl_readVitaleCard = function (resultCallback) {\n var command = {\n s_commandName: \"hl_readVitaleCard\",\n s_sessionId: this.getSessionId(),\n i_getXmlContent: 1\n };\n\n return this.sendCommand(\n command,\n 120,\n resultCallback,\n false,\n (function (self) {\n return function (result) {\n if (result.s_status == \"OK\") {\n self.setState(\"vitaleCardRead\", true);\n self._refreshCallback();\n }\n };\n })(this)\n );\n};\n\nDMPConnect.prototype.hl_getDcParamRegistered = function (state) {\n this.setState(\"DcParameterRegistered\", state);\n this._refreshCallback();\n};\n\n/**\n * @brief Set XML content of a Virtual card.\n * If s_xmlContent is not empty, every call to hl_readVitaleCard will use this content instead of a card.\n *\n * IN\n * {\n * s_xmlContent XML content of the virtual Card.\n * i_cardType Vitale card status.\n * }\n * OUT\n * {\n *\n * }\n *\n * @note This function can only be used for dev, it is disabled in production.\n */\nDMPConnect.prototype.hl_setVitaleXmlContent = function (\n xmlContent,\n aCardType,\n resultCallback\n) {\n var command = {\n s_commandName: \"hl_setVitaleXmlContent\",\n s_sessionId: this.getSessionId(),\n s_xmlContent: xmlContent,\n i_cardType: aCardType\n };\n\n return this.sendCommand(command, 2, resultCallback);\n};\n\n/**\n * @brief Query several object parameters in one call.\n * If no parameter is specified, all of the object dat is dumped.\n *\n * IN\n * \"i_objectHandle\" : handle of the object to query,\n *\n * \"stringIds\" : { Id0 : a parameter id of the object,\n * Id1 : another parameter id of the object\n * ...\n * },\n * \"stringBase64Ids\" : { Id0 : a parameter id of the object,\n * Id1 : another parameter id of the object\n * ...\n * },\n * \"integerIds\" : { Id0 : a parameter id of the object,\n * Id1 : another parameter id of the object\n * ...\n * },\n * \"floatIds\" : { Id0 : a parameter id of the object,\n * Id1 : another parameter id of the object\n * ...\n * },\n * OUT\n *\n * For an object, are returned:\n * - the object parameters ids and value as \"id\":value. See ObjectParameterName enum.\n * - the handle of the object in \"handleId\".\n * - the type of the object in \"type\". See HandleType enum.\n * Example below.\n * {\n * \"9\": \"GENE RPPS\",\n * \"10\": \"ALAIN\",\n * \"11\": \"10\",\n * \"12\": \"1.2.250.1.71.1.2.7\",\n * \"13\": \"SM26\",\n * \"14\": \"899900023351\",\n * \"86\": 25,\n * \"handleId\": 524290,\n * \"type\": 9\n * }\n *\n * A object that is a List is dumped like that (81 = DocumentAuthors)\n * \"81\": {\n * \"handleId\": 65562,\n * \"list\": [\n * {\n * \"9\": \"GENE RPPS\",\n * \"10\": \"ALAIN\",\n * \"11\": \"10\",\n * \"12\": \"1.2.250.1.71.1.2.7\",\n * \"13\": \"SM26\",\n * \"14\": \"899900023351\",\n * \"86\": 25,\n * \"handleId\": 524290,\n * \"type\": 9\n * }\n * ],\n * \"type\": 2\n * },\n */\nDMPConnect.prototype.hl_getObjectParameters = function (\n command,\n resultCallback\n) {\n command.s_commandName = \"hl_getObjectParameters\";\n command.s_sessionId = this.getSessionId();\n\n return this.sendCommand(command, 2, resultCallback);\n};\n\n/**\n * @brief Return the internal handles used by the high level (HL) API.\n *\n * These handles:\n * - can be used with the low level API ;\n * - may not be initialized or be invalid. Their validity can be checked with checkValidity() and/or handleExists() for example.\n *\n * @note If user only want to know if a given session exists, it should use hl_sessionExists instead (@see bellow), it is faster and does not lock internal state.\n *\n * IN\n * OUT\n * \"i_error\" : The error object used by all HL functions. Should never be destroyed.\n * \"i_cpxReader\" : The CPx reader object (GALSS or PC/SC).\n * \"i_cpxCard\" : The CPx inserted in the CPx reader. Used by all CPx-related functions (hl_readCpxCard, hl_signWithCpxCard, all DMP functions, etc.)\n * \"i_vitaleCard\" : The Vitale card.\n *\n * \"i_practiceLocation\" : DMP connector: Current practice location used for all DMP access.\n * \"i_authToken\" : DMP connector: Authentification token (CPS PKCS#11 token) used to authenticate the user and sign data.\n * \"i_connection\" : DMP connector: The TLS connection to the DMP.\n * \"i_caCert\" : DMP connector: The DMP CA certificate object.\n * \"i_user\" : DMP connector: The user object created from the CPx data.\n * \"i_dmpConnector\" : DMP connector object. The main object of the low level API.\n *\n * \"i_documentsFound\" : List of the documents found after a call to hl_findDocuments. Can be reused with getDocumentsExtraMetadata() for example.\n */\nDMPConnect.prototype.hl_getSessionState = function (command, resultCallback) {\n command = command || {};\n command.s_commandName = \"hl_getSessionState\";\n command.s_sessionId = this.getSessionId();\n\n return this.sendCommand(command, 10, resultCallback);\n};\n\n/**\n * @brief Test if a given session exists.\n *\n * IN\n * OUT\n * i_exists (1) the session exists (0) the session does not or no longer exists.\n * s_timeout (*) Timeout of the session. (Format: HH:MM'SS\")\n * s_remaining (*) Remaining time before timeout. (Format: HH:MM'SS\")\n *\n * (*) Only present if i_exists is equal to 1.\n *\n * @note Whereas hl_getSessionState update internal timestamp, this function does not.\n * (ie: calling this function in a loop may not prevent the session to expire).\n */\nDMPConnect.prototype.hl_sessionExists = function (command, resultCallback) {\n command = command || {};\n command.s_commandName = \"hl_sessionExists\";\n command.s_sessionId = this.getSessionId();\n\n return this.sendCommand(command, 5, resultCallback);\n};\n\n/**\n * @brief Create a new connection object\n *\n * This handle can be used in sendHttpRequest for example\n *\n * IN\n * \"s_server\" : The URL domain (ex: http://google.fr) or IP (ex: 192.168.0.1)\n * \"i_requestTimeout\" : Timeout of the connection\n * \"s_proxyIpOrUrl\" : [Optional] Proxy IP (ex: 127.0.0.1) or URL (http://myproxy.com)\n * \"i_proxyPort\" : [Optional] Proxy port\n * \"s_proxyLogin\" : [Optional] Proxy login\n * \"s_proxyPassword\" : [Optional] Proxy password\n * \"s_caCertName\" : [Optional] Name of the CA cert file to use.\n * \"i_usePkcs11\" : [Optional] Use the current CPS card PKCS#11 token to establish the connection.\n * \"i_disableHttpRedirections\" : [Optional] If true, disable HTTP 3XX redirections.\n * \"i_disableOcspRevocationCheck\": [Optional] Id true, disable certificate revocation check (OCSP).\n * OUT\n * \"i_connectionHandle\" : handle of the connection\n *\n * @note: if no caCertName given, the default one, handles connections to :\n * - \"serveurs DMP de l'IGC Santé et de l'IGC CPS\";\n * - \"serveurs MSS ASIP\"\n * - \"Téléservices de la CNAMTS (TLSi)\"\n */\nDMPConnect.prototype.hl_createConnection = function (command, resultCallback) {\n command = command || {};\n command.s_commandName = \"hl_createConnection\";\n command.s_sessionId = this.getSessionId();\n\n return this.sendCommand(command, 10, resultCallback);\n};\n\n/*\n * @brief Get lists of Interoperability Framework codes, a.k.a. \"Jeux de valeurs\" in the CI-SIS documentation.\n * 8 type of codes are available, see below.\n *\n * IN\n * {\n * // One or more of the following identifiers.\n * s_codeIds: [\n * \"healthcareSettings\" // \"Cadre de soins\". Ex.: SA07, SA08, etc.\n * \"practiceSettings\", // \"Cadre d'exercice\". Ex.: AMBULATOIRE, DEPISTAGE, MAD, etc.\n * \"activitySectors\", // \"Secteur d'activité\". Ex.: SA01 .. SA54\n * \"docFormats\", // Document formats (Texte, RTF, PDF, etc.). Ex.: urn:ihe:iti:xds-sd:text:2008, urn:ihe:iti-fr:xds-sd:rtf:2010, etc.\n * \"docTypes\", // Document types (CR de Biologie, Synthese, etc.). Ex.: 11488-4, 11506-3, etc.\n * \"professions\", // Healthcare professionals profession codes.\n * \"physicianSpecialities\", // Specialities for \"Medecins\" profession (code: 10).\n * \"pharmacistSpecialities\" // Specialities for \"Pharmacien\" profession (code: 21).\n * \"dentistSpecialities\" // Specialities for \"Chirurgien-Dentiste\" profession (code: 40).\n * \"docCategories\", // Document categories (Compte rendu, Synthèse, etc.). Ex: 10, 11, 31, etc.\n * \"docTypesToDocCategories\", // Document category associated to a document type.\n * \"docTypesHistory\", // All document types (same content as \"docTypes\" obut also includes obsolète document type codes).\n * \"docTypesTranslation\", // Associative table used to get up to date document type code, given a type code (ie: get new value from a putative obsolete one).\n * \"adeliSpecialties\", // ADELI specialties.\n * \"amoSpecialties\" // AMO specialties.\n * ]\n * }\n * OUT\n * {\n * healthcareSettings : // Name if the item = identifier given in s_codeIds\n * [\n * {\n * s_codeSystem: \"1.2.250.1.71.4.2.4\",\n * s_code: \"SA07\",\n * s_displayName: \"Cabinet individuel\"\n * },\n * {\n * ...\n * },\n * ],\n * practiceSettings :\n * [\n * {\n * s_codeSystem: \"1.2.250.1.213.1.1.4.9\",\n * s_code: \"SA01\",\n * s_displayName: \"Ambulatoire\"\n * },\n * {\n * ...\n * },\n * ...\n * }\n */\nDMPConnect.prototype.hl_getInteropCodes = function (command, resultCallback) {\n command.s_commandName = \"hl_getInteropCodes\";\n command.s_sessionId = this.getSessionId();\n\n return this.sendCommand(command, 2, resultCallback);\n};\n\n/**\n * @brief Get CIS (Code Identifiant de Spécialité) codes.\n *\n * IN\n * (*) Codes : [ ] // Array of codes to retreive.\n * (*) s_name : // Name of the product. Can contain wildcard '%' or '_' like in SQL query.\n * (*) s_form: // Administration. Can contain wildcard '%' or '_' like in SQL query.\n * (*) s_authorizationDateBegin // Get only codes where authorization starts after the given date. format : YYYY-MM-DD\n * (*) s_authorizationDateEnd // Get only codes where authorization starts before the given date. format : YYYY-MM-DD\n * (*) i_marketed // Get only marketed products (1) or non marketed products (0).\n * (*) s_owner // Owner of the product. Can contain wildcard '%' or '_' like in SQL query.\n * OUT\n * Codes [] // Array of codes that match the given query.\n *\n * Example of returned code :\n * {\n * \"s_code\": \"69742445\",\n * \"s_name\": \"DOLI ETAT GRIPPAL PARACETAMOL/VITAMINE C/PHENIRAMINE 500 mg/200 mg/25 mg, poudre pour solution buvable en sachet\",\n * \"s_form\": \"poudre pour solution buvable\",\n * \"Routes\": [\n * \"orale\"\n * ],\n * \"i_status\": 1,\n * \"s_procedureType\": \"Procédure nationale\",\n * \"i_marketed\": 0,\n * \"s_date\": \"2014-02-05\",\n * \"i_alert\": 2,\n * \"s_ueId\": \"\",\n * \"Owners\": [\n * \" OPELLA HEALTHCARE FRANCE\"\n * ],\n * \"i_surveillance\": 0\n * },\n */\nDMPConnect.prototype.hl_getCisCodes = function (command, resultCallback) {\n command = command || {};\n command.s_commandName = \"hl_getCisCodes\";\n command.s_sessionId = this.getSessionId();\n\n return this.sendCommand(command, 5, resultCallback);\n};\n\n/**\n * @brief Get ATC codes. (Classification Anatomique, Thérapeutique et Chimique).\n *\n * IN\n * (*) Codes\n * (*) s_nameFr\n * (*) s_nameEn\n * (*) i_level\n * OUT\n * {\n * \"Codes\" : []\n * }\n * (*) Optional\n * where each code is :\n * {\n * \"s_code\" : \"\" ATC code.\n * \"Names\" :\n * {\n * \"s_fr\" : \"\", // French translation.\n * \"s_en\" : \"\" // Original name (english).\n * },\n * \"i_level\" : // Hierarchical level.\n * }\n */\nDMPConnect.prototype.hl_getAtcCodes = function (command, resultCallback) {\n command = command || {};\n command.s_commandName = \"hl_getAtcCodes\";\n command.s_sessionId = this.getSessionId();\n\n return this.sendCommand(command, 2, resultCallback);\n};\n\n/**\n * @brief Get most up to date version of a typeCode.\n *\n * IN\n * {\n * s_typeCode // typeCode to get of up to date version of.\n * }\n * OUT\n * {\n * s_typeCode // Last version of the input typeCode.\n * }\n *\n * @note If input s_typeCode is already the lattest version of the typecode, the function returns the input typeCode value.\n */\nDMPConnect.prototype.hl_getUpdatedTypeCode = function (\n typeCode,\n resultCallback\n) {\n command = {};\n command.s_typeCode = typeCode;\n command.s_commandName = \"hl_getUpdatedTypeCode\";\n command.s_sessionId = this.getSessionId();\n\n return this.sendCommand(command, 2, resultCallback);\n};\n\n/**\n * @brief Get the set of tables inside the NOS database.\n *\n * IN\n * {\n *\n * }\n * OUT\n * {\n * TableNames : [ \"\", \"\" ];\n * }\n */\nDMPConnect.prototype.hl_getNosTableNames = function (resultCallback) {\n command = {};\n command.s_commandName = \"hl_getNosTableNames\";\n command.s_sessionId = this.getSessionId();\n\n return this.sendCommand(command, 5, resultCallback);\n};\n\n/**\n * @brief Get the codes associated with the given NOS tables.\n *\n * IN\n * {\n * TableNames : []\n * }\n * OUT\n * {\n * \"TableName1\" : [ { s_code, s_codeSystem , s_displayName }, ... ],\n * \"TableName2\" : [ ... ]\n * }\n */\nDMPConnect.prototype.hl_getNosCodes = function (tableArray, resultCallback) {\n command = {};\n command.s_commandName = \"hl_getNosCodes\";\n command.s_sessionId = this.getSessionId();\n\n command.TableNames = tableArray;\n\n return this.sendCommand(command, 5, resultCallback);\n};\n\n/**\n * @brief Get the set of tables inside the CISIS database.\n *\n * IN\n * {\n *\n * }\n * OUT\n * {\n * TableNames : [ \"\", \"\" ];\n * }\n */\nDMPConnect.prototype.hl_getCiSisTableNames = function (resultCallback) {\n command = {};\n command.s_commandName = \"hl_getCiSisTableNames\";\n command.s_sessionId = this.getSessionId();\n\n return this.sendCommand(command, 5, resultCallback);\n};\n\n/**\n * @brief Get the codes associated with the given CISIS tables.\n *\n * IN\n * {\n * TableNames : []\n * }\n * OUT\n * {\n * \"TableName1\" : [ { s_code, s_codeSystem , s_displayName }, ... ],\n * \"TableName2\" : [ ... ]\n * }\n *\n */\nDMPConnect.prototype.hl_getCiSisCodes = function (tableArray, resultCallback) {\n command = {};\n command.s_commandName = \"hl_getCiSisCodes\";\n command.s_sessionId = this.getSessionId();\n\n command.TableNames = tableArray;\n\n return this.sendCommand(command, 5, resultCallback);\n};\n\n// ---------------------------------------------------------------------------------------------------------------------------------\n// Temporary User-defined session data\n// ---------------------------------------------------------------------------------------------------------------------------------\n// Note:\n//\n// Session data(s) consist(s) in user defined data stored as string in base 64, that can be get/set using uniques ID. The following\n// functionalities are available:\n//\n// - User can add a new data (in this case, a corresponding ID will be returned\n// - User can update an existing data (using it's ID as reference)\n// - User can get value of an existing data\n// - User can remove an existing session data\n// - User can remove all session data\n//\n// There is a maximum size on all of the user session data:\n//\n// - User cannot set a session data that exceed the maximum size\n// - User cannot add a session data that would result in a total of all it's session data above the maximum size\n// - User can query the current size of his session data\n// - User can query the maximum size allowed for the session data\n\n/**\n * @brief Set or Update a user defined session data\n *\n * IN\n * {\n * \"s_sessionDataId\" : [Optional] User session data ID. If set try to update existing data, if not set create a new one.\n * \"s_sessionData64\" : Data to set/update (string in base64)\n * }\n * OUT\n * {\n * \"s_sessionDataId\" : ID of the data that have been set/updated\n * }\n *\n * @note If session data exceed maximum allowed size (@see hl_getMaximumSessionDataSize) data is not added and an error is returned\n * @note If session data size plus existing data size exceed maximum allowed size (@see hl_getMaximumSessionDataSize) data is not added and an error is returned\n * @note If sessionDataId is set but no existing data with this ID exists, data is not added and an error is returned\n */\nDMPConnect.prototype.hl_setSessionData = function (command, resultCallback) {\n command = command || {};\n command.s_commandName = \"hl_setSessionData\";\n command.s_sessionId = this.getSessionId();\n\n return this.sendCommand(command, 10, resultCallback);\n};\n\n/**\n * @brief Get an existing session data\n *\n * IN\n * {\n * \"s_sessionDataId\" : ID of the session data to get\n * }\n * OUT\n * {\n * \"s_sessionData64\" : content of the session data to get\n * }\n *\n * @note If session data does not exists, an error is returned\n */\nDMPConnect.prototype.hl_getSessionData = function (command, resultCallback) {\n command = command || {};\n command.s_commandName = \"hl_getSessionData\";\n command.s_sessionId = this.getSessionId();\n\n return this.sendCommand(command, 10, resultCallback);\n};\n\n/**\n * @brief Remove an existing data\n *\n * IN\n * {\n * \"s_sessionDataId\" : ID of the session data to remove\n * }\n * OUT\n *\n * @note If session data does not exists, an error is returned\n */\nDMPConnect.prototype.hl_removeSessionData = function (command, resultCallback) {\n command = command || {};\n command.s_commandName = \"hl_removeSessionData\";\n command.s_sessionId = this.getSessionId();\n\n return this.sendCommand(command, 10, resultCallback);\n};\n\n/**\n * @brief Clear all session data\n *\n * IN\n * OUT\n *\n */\nDMPConnect.prototype.hl_clearSessionData = function (resultCallback) {\n var command = {\n s_commandName: \"hl_clearSessionData\",\n s_sessionId: this.getSessionId()\n };\n\n return this.sendCommand(command, 10, resultCallback);\n};\n\n/**\n * @brief Get current size of the session data\n *\n * IN\n * OUT\n * {\n * \"i_sessionDataSize\" : Current size (in byte) of the session data(s)\n * }\n */\nDMPConnect.prototype.hl_getSessionDataSize = function (resultCallback) {\n var command = {\n s_commandName: \"hl_getSessionDataSize\",\n s_sessionId: this.getSessionId()\n };\n\n return this.sendCommand(command, 10, resultCallback);\n};\n\n/**\n * @brief Get maximum allowed size for the session data\n *\n * IN\n * OUT\n * {\n * \"hl_getMaximumSessionDataSize\" : Maximum allowed size (in byte) for the session data(s)\n * }\n */\nDMPConnect.prototype.hl_getMaximumSessionDataSize = function (resultCallback) {\n var command = {\n s_commandName: \"hl_getMaximumSessionDataSize\",\n s_sessionId: this.getSessionId()\n };\n\n return this.sendCommand(command, 10, resultCallback);\n};\n\n// ---------------------------------------------------------------------------------------------------------------------------------\n// Persistant user data\n// ---------------------------------------------------------------------------------------------------------------------------------\n// Note:\n// Persistant data consist in data that can be read/save between sessions\n// Unlike session data:\n// - Data is not destroyed at the end of the session\n// - Data is unique (ie: only one block of persistant memory can be get/set), after each set, the existing data is overwritten\n//\n// Like session data:\n// - a data can be saved or retrieved\n// - user can query the current size of the persistant data\n// - a maximum size limit exists for persistant data\n// - user can query the maximum allowed size\n//\n// If user data exceed the maximum allowed size, an error is returned and the current persistent data is keep untouched.\n//\n\n/**\n * @brief set the persistant data\n *\n * IN\n * {\n * \"s_persistantData64\" : A base64 string containing the data to store in the persistant storage\n * }\n * OUT\n *\n * @note If the given data size exceed maximum allowed size (@see hl_getMaximumPersistantDataSize), an error is returned and the existing data size is kept untouched.\n * @note Existing persistant data is overwritten by this function.\n */\nDMPConnect.prototype.hl_setPersistantData = function (command, resultCallback) {\n command = command || {};\n command.s_commandName = \"hl_setPersistantData\";\n command.s_sessionId = this.getSessionId();\n\n return this.sendCommand(command, 10, resultCallback);\n};\n\n/**\n * @brief get persistant data\n *\n * IN\n *\n * OUT\n * {\n * \"s_persistantData64\" : A base64 string containing the data stored in the persistant storage\n * }\n *\n * @note If no existing persistant data exists, \"s_persistantData64\" will contains an empty string\n */\nDMPConnect.prototype.hl_getPersistantData = function (resultCallback) {\n var command = {\n s_commandName: \"hl_getPersistantData\",\n s_sessionId: this.getSessionId()\n };\n\n return this.sendCommand(command, 10, resultCallback);\n};\n\n/**\n * @brief Clear existing persistant data\n *\n * IN\n *\n * OUT\n */\nDMPConnect.prototype.hl_clearPersistantData = function (resultCallback) {\n var command = {\n s_commandName: \"hl_clearPersistantData\",\n s_sessionId: this.getSessionId()\n };\n\n return this.sendCommand(command, 10, resultCallback);\n};\n\n/**\n * @brief Get existing persistant data size\n *\n * IN\n *\n * OUT\n * {\n * \"i_persistantDataSize\" : Size (in byte) of the persistant data currently stored\n * }\n */\nDMPConnect.prototype.hl_getPersistantDataSize = function (resultCallback) {\n var command = {\n s_commandName: \"hl_getPersistantDataSize\",\n s_sessionId: this.getSessionId()\n };\n\n return this.sendCommand(command, 10, resultCallback);\n};\n\n/**\n * @brief Get maximum allowed size of the persistant data\n *\n * IN\n *\n * OUT\n * {\n * \"i_maximumPersistantDataSize\" : Maximum size (in byte) of the persistant data that can be stored\n * }\n */\nDMPConnect.prototype.hl_getMaximumPersistantDataSize = function (\n resultCallback\n) {\n var command = {\n s_commandName: \"hl_getMaximumPersistantDataSize\",\n s_sessionId: this.getSessionId()\n };\n\n return this.sendCommand(command, 10, resultCallback);\n};\n\n// ---------------------------------------------------------------------------------------------------------------------------------\n// Low level API functions.\n// ---------------------------------------------------------------------------------------------------------------------------------\n// Note:\n// The reference documentation of the functions below is available in the C headers and the C API specification PDF.\n// JavaScript and C functions names are the same.\n//\n// Most of the time, the expected JSON parameter have the same name than the C parameters prefixed with the parameter type ('i_', 's_', etc.).\n//\n// Ex.: D_HANDLE getObjectFromList( D_HANDLE list, unsigned int position, D_HANDLE error );\n// Expects the following parameters:\n// {\n// \"i_list\" : xxx,\n// \"i_position\": xxx\n// }\n//\n// The last parameter 'D_HANDLE error'' is always omitted: the internal session error object is used.\n//\n// Example of call:\n// dmpConnectInstance.getParameterString( { i_globalParameter: DMPConnect.GlobalParameterName.VersionName } );\n\n/**\n * @brief Helper function for low level API function calls.\n * Can be used directly, however most of the available calls are wrapped in a specific function.\n *\n * For command taking an 'i_globalParameter' parameter, see DMPConnect.GlobalParameterName.\n *\n * For command taking an 'i_parameter' parameter, see DMPConnect.ObjectParameterName.\n * In this last case, the function will also need the object handle in i_object (decimal value).\n *\n * @param {string} commandName Id of the command. Ex.: \"getParameterString\", etc.\n * @param {object} commandParameters Object holding the function parameters in its properties.\n * Ex.: { \"i_globalParameter\": DMPConnect.GlobalParameterName.VersionName }\n * @param {function} resultCallback The callback that take the result from sendCommand\n */\nDMPConnect.prototype.lowLevelApiFunctionCall = function (\n commandName,\n commandParameters,\n resultCallback\n) {\n var command = {};\n command.s_commandName = commandName;\n command.s_sessionId = this.getSessionId();\n\n // Merge the function-specific parameters.\n for (var paramName in commandParameters) {\n command[paramName] = commandParameters[paramName];\n }\n\n // Execute the command.\n return this.sendCommand(command, 10, resultCallback);\n};\n\n// IN : i_globalParameter, i_resultInBase64\n// OUT: s_utf8String, s_utf8StringSize\nDMPConnect.prototype.getParameterString = function (\n commandParameters,\n resultCallback\n) {\n this.lowLevelApiFunctionCall(\n \"getParameterString\",\n commandParameters,\n resultCallback\n );\n};\n\n// IN : i_globalParameter\n// OUT: i_returnValue\nDMPConnect.prototype.getParameterStringSize = function (\n commandParameters,\n resultCallback\n) {\n this.lowLevelApiFunctionCall(\n \"getParameterStringSize\",\n commandParameters,\n resultCallback\n );\n};\n\n// IN : i_globalParameter\n// OUT: i_returnValue\nDMPConnect.prototype.getParameterInt = function (\n commandParameters,\n resultCallback\n) {\n this.lowLevelApiFunctionCall(\n \"getParameterInt\",\n commandParameters,\n resultCallback\n );\n};\n\n// IN : i_globalParameter\n// OUT: i_returnValue\nDMPConnect.prototype.getObjectParameterStringSize = function (\n commandParameters,\n resultCallback\n) {\n this.lowLevelApiFunctionCall(\n \"getObjectParameterStringSize\",\n commandParameters,\n resultCallback\n );\n};\n\n// IN : i_parameter, i_object, i_resultInBase64\n// OUT: s_utf8String, s_utf8StringSize\nDMPConnect.prototype.getObjectParameterString = function (\n commandParameters,\n resultCallback\n) {\n this.lowLevelApiFunctionCall(\n \"getObjectParameterString\",\n commandParameters,\n resultCallback\n );\n};\n\n// IN : i_parameter, i_object\n// OUT: i_returnValue\nDMPConnect.prototype.getObjectParameterInt = function (\n commandParameters,\n resultCallback\n) {\n this.lowLevelApiFunctionCall(\n \"getObjectParameterInt\",\n commandParameters,\n resultCallback\n );\n};\n\n// IN : i_parameter, i_object\n// OUT: f_returnValue\nDMPConnect.prototype.getObjectParameterFloat = function (\n commandParameters,\n resultCallback\n) {\n this.lowLevelApiFunctionCall(\n \"getObjectParameterFloat\",\n commandParameters,\n resultCallback\n );\n};\n\n// IN : i_list, i_position\n// OUT: i_returnValue\nDMPConnect.prototype.getObjectFromList = function (\n commandParameters,\n resultCallback\n) {\n this.lowLevelApiFunctionCall(\n \"getObjectFromList\",\n commandParameters,\n resultCallback\n );\n};\n\n// IN : i_list\n// OUT: i_returnValue\nDMPConnect.prototype.getListSize = function (\n commandParameters,\n resultCallback\n) {\n this.lowLevelApiFunctionCall(\n \"getListSize\",\n commandParameters,\n resultCallback\n );\n};\n\n// IN : i_list, i_position\n// OUT: i_returnValue\nDMPConnect.prototype.copyObjectFromList = function (\n commandParameters,\n resultCallback\n) {\n this.lowLevelApiFunctionCall(\n \"copyObjectFromList\",\n commandParameters,\n resultCallback\n );\n};\n\n// IN : i_handle\n// OUT: i_returnValue\nDMPConnect.prototype.handleExists = function (\n commandParameters,\n resultCallback\n) {\n this.lowLevelApiFunctionCall(\n \"handleExists\",\n commandParameters,\n resultCallback\n );\n};\n\n// IN : i_handle\n// OUT: i_returnValue\nDMPConnect.prototype.checkValidity = function (\n commandParameters,\n resultCallback\n) {\n this.lowLevelApiFunctionCall(\n \"checkValidity\",\n commandParameters,\n resultCallback\n );\n};\n\n// IN : i_handle\n// OUT: i_returnValue\nDMPConnect.prototype.getHandleType = function (\n commandParameters,\n resultCallback\n) {\n this.lowLevelApiFunctionCall(\n \"getHandleType\",\n commandParameters,\n resultCallback\n );\n};\n\n// IN : i_type\n// OUT: i_returnValue\nDMPConnect.prototype.createObject = function (\n commandParameters,\n resultCallback\n) {\n this.lowLevelApiFunctionCall(\n \"createObject\",\n commandParameters,\n resultCallback\n );\n};\n\n// IN : i_handle\nDMPConnect.prototype.releaseObject = function (\n commandParameters,\n resultCallback\n) {\n this.lowLevelApiFunctionCall(\n \"releaseObject\",\n commandParameters,\n resultCallback\n );\n};\n\n// IN : i_list\nDMPConnect.prototype.releaseList = function (\n commandParameters,\n resultCallback\n) {\n this.lowLevelApiFunctionCall(\n \"releaseList\",\n commandParameters,\n resultCallback\n );\n};\n\n// IN : i_error\nDMPConnect.prototype.releaseErrorObject = function (\n commandParameters,\n resultCallback\n) {\n this.lowLevelApiFunctionCall(\n \"releaseErrorObject\",\n commandParameters,\n resultCallback\n );\n};\n\n// Currently for debug only.\n// ---------------------------------------------------------------------------------------------------------------------------------\n\n/**\n * @brief Return either the server log, the log of DmpConnect or both logs.\n *\n * Log data is returned in base 64, with '\\n' as new line delimiter.\n *\n * All input parameters below are optional.\n * The default behaviour (no parameters defined) is to return the last 50 lines of both logs.\n *\n * IN\n * i_getServerLog : Optional. 1: retreive the log. 0: do not retreive it. Default: 1\n * i_getDmpConnectLog : idem.\n * i_serverLogNbLastLines : Optional. Default: 50\n * i_dmpConnectLogNbLastLines :Optional. Default: 50\n * OUT\n * s_serverLogBase64 : Defined if i_getServerLog != 0\n * s_dmpConnectLogBase64 : Defined if i_getDmpConnectLog != 0\n */\nDMPConnect.prototype.getLogsTail = function (command, resultCallback) {\n command = command || {};\n command.s_commandName = \"getLogsTail\";\n\n return this.sendCommand(command, 4, resultCallback);\n};\n\n/**\n * @brief Return either the server log, the log of DmpConnect or both logs.\n * This is the log associated with the current JS process where the session resides.\n *\n * Log data is returned in base 64, with '\\n' as new line delimiter.\n *\n * All input parameters below are optional.\n * The default behaviour (no parameters defined) is to return the last 50 lines of both logs.\n *\n * IN\n * i_getServerLog : Optional. 1: retreive the log. 0: do not retreive it. Default: 1\n * i_getDmpConnectLog : idem.\n * i_serverLogNbLastLines : Optional. Default: 50\n * i_dmpConnectLogNbLastLines :Optional. Default: 50\n * OUT\n * s_serverLogBase64 : Defined if i_getServerLog != 0\n * s_dmpConnectLogBase64 : Defined if i_getDmpConnectLog != 0\n */\nDMPConnect.prototype.hl_getSessionLogsTail = function (\n command,\n resultCallback\n) {\n command = command || {};\n command.s_commandName = \"hl_getSessionLogsTail\";\n command.s_sessionId = this.getSessionId();\n\n return this.sendCommand(command, 4, resultCallback);\n};\n\n/**\n * Return system information.\n *\n *\n * IN\n * {\n *\n * }\n * OUT\n * {\n * s_platform : \"Windows\" | \"macOS\" | \"Linux\"\n * i_nbSlaveProcess\n * i_nbSession\n * Sessions : []\n * Processes: []\n * }\n *\n * Session array is composed of:\n * {\n * s_processId\n * s_sessionId\n * }\n *\n * Process array is composed of:\n * {\n * s_processId // Internal Id, can be used to make association between the process and the session.\n * s_workingDirectory\n * s_integratorId\n * s_applicationId\n * i_processPort // Communication port of the process (listening port of the slave).\n * i_isTse // False on macOS or Linux.\n * i_isRunning\n * }\n */\nDMPConnect.prototype.hl_getSystemInformation = function (\n command,\n resultCallback\n) {\n command = command || {};\n command.s_commandName = \"hl_getSystemInformation\";\n\n return this.sendCommand(command, 4, resultCallback);\n};\n\n/**\n * @brief Get list of active features in the current build.\n *\n * IN\n * {\n *\n * }\n * OUT\n * {\n * \"Features\" = [{}] // List of features.\n * }\n */\nDMPConnect.prototype.hl_activeFeatures = function (command, resultCallback) {\n command = command || {};\n command.s_commandName = \"hl_activeFeatures\";\n\n return this.sendCommand(command, 4, resultCallback);\n};\n\n/**\n * @brief Indicate if Wireless mode is enabled.\n *\n * IN\n * {\n *\n * }\n * OUT\n * {\n * i_enabled\n * }\n */\nDMPConnect.prototype.hl_isWirelessModeEnabled = function (\n command,\n resultCallback\n) {\n command = command || {};\n command.s_commandName = \"hl_isWirelessModeEnabled\";\n\n return this.sendCommand(command, 4, resultCallback);\n};\n\n/**\n * @brief Get current log levels.\n *\n * IN\n * {\n *\n * }\n * OUT\n * {\n * i_dmpConnectLogLevel\n * i_dmpConnectJsLogLevel\n * }\n */\nDMPConnect.prototype.getLogLevels = function (command, resultCallback) {\n command = command || {};\n command.s_commandName = \"getLogLevels\";\n\n return this.sendCommand(command, 4, resultCallback);\n};\n\n/**\n * @brief Set log levels.\n *\n * IN\n * {\n * i_dmpConnectLogLevel\n * i_dmpConnectJsLogLevel\n * }\n * OUT\n * {\n *\n * }\n */\nDMPConnect.prototype.setLogLevels = function (\n command,\n iDmpConnectLevel,\n iDmpConnectJsLevel,\n resultCallback\n) {\n command = command || {};\n\n command.s_commandName = \"setLogLevels\";\n command.i_dmpConnectLogLevel = iDmpConnectLevel;\n command.i_dmpConnectJsLogLevel = iDmpConnectJsLevel;\n\n return this.sendCommand(command, 4, resultCallback);\n};\n\n/**\n * @brief Return either the server log, the log of DmpConnect or both logs.\n * This is the log associated with the current JS process where the session resides.\n *\n * Log data is returned in base 64, with '\\n' as new line delimiter.\n *\n * All input parameters below are optional.\n * The default behaviour (no parameters defined) is to return the last 50 lines of both logs.\n *\n * IN\n * i_getServerLog : Optional. 1: retreive the log. 0: do not retreive it. Default: 1\n * i_getDmpConnectLog : idem.\n * i_serverLogNbLastLines : Optional. Default: 50\n * i_dmpConnectLogNbLastLines :Optional. Default: 50\n * OUT\n * s_serverLogBase64 : Defined if i_getServerLog != 0\n * s_dmpConnectLogBase64 : Defined if i_getDmpConnectLog != 0\n */\nDMPConnect.prototype.hl_getSessionLogsTail = function (\n command,\n resultCallback\n) {\n command = command || {};\n command.s_commandName = \"hl_getSessionLogsTail\";\n command.s_sessionId = this.getSessionId();\n\n return this.sendCommand(command, 4, resultCallback);\n};\n\n/**\n * @brief Convert a date to standard format:\n * - if it's already standard, return same date\n * - if it's lunar, convert it to standard date\n *\n * @param {string} aDate Input date (YYMMDD or DDMMYYYY)\n *\n * IN\n * \"s_date\"\n * OUT\n * \"s_date\"\n */\nDMPConnect.prototype.hl_convertLunarDateToStandardDate = function (\n aDate,\n resultCallback\n) {\n command = {};\n command.s_date = aDate;\n command.s_commandName = \"hl_convertLunarDateToStandardDate\";\n command.s_sessionId = this.getSessionId();\n\n return this.sendCommand(command, 5, resultCallback);\n};\n\n/**\n * @brief Convert a pdf to a pdf/a1\n *\n * IN\n * \"s_contentInBase64\"\n * (*) \"i_pdfa1ImageResolution\" // default value: 200\n * (*) \"i_pdfa1IgnoreTransparency\"\n * OUT\n * \"s_fileContentInBase64\"\n *\n * (*) Optionnal\n */\nDMPConnect.prototype.hl_convertPdfToPdfA1 = function (\n pdfInBase64,\n command,\n resultCallback\n) {\n command = command || {};\n command.s_commandName = \"hl_convertPdfToPdfA1\";\n command.s_sessionId = this.getSessionId();\n\n command.s_contentInBase64 = pdfInBase64;\n\n return this.sendCommand(command, 90, resultCallback);\n};\n\n/**\n * @brief Compute century for a birth date without century\n *\n * @param {string} aDate Date from which century must be computed.\n * @param {int} aQuality Quality of the patient, important value is 6 that indicate that patient is a child.\n *\n * IN\n * \"s_date\"\n * \"i_quality\"\n * OUT\n * \"i_century\"\n */\nDMPConnect.prototype.hl_computeBirthDayCentury = function (\n aDate,\n aQuality,\n resultCallback\n) {\n command = {};\n command.s_date = aDate;\n command.i_quality = aQuality;\n command.s_commandName = \"hl_computeBirthDayCentury\";\n command.s_sessionId = this.getSessionId();\n\n return this.sendCommand(command, 5, resultCallback);\n};\n\n/**\n * @brief Regularize a birth date if needed.\n * Regularization perform the two steps:\n * 1. It standardize date, if it's a lunar one ;\n * 2. It adds a century if date is in format YYMMDD.\n *\n * @param {string} aDate Input date (format YYMMDD or DDMMYYYY).\n * @param {int} aQuality Quality of the patient, important value is 6 that indicate that patient is a child.\n *\n * IN\n * s_date\n * i_quality\n * OUT\n * s_date\n */\nDMPConnect.prototype.hl_regularizeBirthDateIfNeeded = function (\n aDate,\n aQuality,\n resultCallback\n) {\n command = {};\n command.s_date = aDate;\n command.i_quality = aQuality;\n command.s_commandName = \"hl_regularizeBirthDateIfNeeded\";\n command.s_sessionId = this.getSessionId();\n\n return this.sendCommand(command, 5, resultCallback);\n};\n\n/**\n * @brief Extract document content based on it's CDA.\n *\n * IN\n * {\n * s_cdaContentInBase64 CDA content in Base64 format.\n * }\n * OUT\n * {\n * s_title,\n * s_uniqueId,\n * s_typeCode,\n * i_documentFormat\n * s_documentFormatCode\n * s_documentFormatDescription\n *\n * Patient\n * {\n * s_ins\n * s_insType\n * s_birthName\n * s_commonName\n * s_birthGiven\n * s_commonGiven\n * s_birthDate\n * i_sex\n * },\n * Authenticators [] (*) Only presnet if there's at least one item.\n * Authors [] (*) Only presnet if there's at least one item.\n * EventCodes [] (*) Only presnet if there's at least one item.\n * Informants [] (*) Only presnet if there's at least one item.\n * IntendedRecipients [] (*) Only presnet if there's at least one item.\n * DataEnterer {} (*) Only presnet if there's a Data enterer.\n * Participants [] (*) Only presnet if there's at least one item.\n * Performer {}\n * }\n */\nDMPConnect.prototype.hl_getDocumentFromCda = function (\n aDocumentInBase64,\n resultCallback\n) {\n command = {};\n command.s_commandName = \"hl_getDocumentFromCda\";\n command.s_sessionId = this.getSessionId();\n command.s_cdaContentInBase64 = aDocumentInBase64;\n\n return this.sendCommand(command, 15, resultCallback);\n};\n\n/**\n * @brief Extract documents content base on an IHE_XDM archive.\n *\n * IN\n * {\n * s_iheXdmContentArchiveInBase64 Content of the IHE_XDM archive in Base64 format.\n * }\n * OUT\n * {\n * Documents [] Set of documents contained in IHE_XDM archive.\n * }\n *\n * @note Document content is the same as hl_getDocumentFromCda output.\n * @note Only the document referenced in the METADATA.XML are extracted.\n */\nDMPConnect.prototype.hl_getDocumentsFromIheXdm = function (\n aDocumentInBase64,\n resultCallback\n) {\n command = {};\n command.s_commandName = \"hl_getDocumentsFromIheXdm\";\n command.s_sessionId = this.getSessionId();\n command.s_iheXdmContentArchiveInBase64 = aDocumentInBase64;\n\n return this.sendCommand(command, 15, resultCallback);\n};\n\n// ---------------------------------------------------------------------------------------------------------------------------------\n// definitions-common.h\n// ---------------------------------------------------------------------------------------------------------------------------------\n\nDMPConnect.DMPCONNECT_VERSION_MAJOR = 3;\nDMPConnect.DMPCONNECT_VERSION_MINOR = 0;\nDMPConnect.DMPCONNECT_VERSION_BUILD = 0;\n\n/**\n * @brief Log levels.\n *\n * For use with setupLogOutput().\n *\n */\nDMPConnect.LogVerbosity = {\n Disabled: 0x00, ///< No output at all.\n Fatal: 0x01, ///< Only fatal error messages are shown.\n Errors: 0x02, ///< Previous + standard error messages.\n Warnings: 0x03, ///< Previous + warning error messages.\n Infos: 0x04, ///< Previous + informative messages.\n Dev: 0x05 ///< Previous + debug infos for developers. Note: to be able to see details about network-related operations (cURL, OpenSSL) this log level must be set at the initialization step.\n};\n\nDMPConnect.ConsoleOutputMode = {\n ConsoleOutputEnabled: 0x10000, ///< Log output is done into the console and the log file.\n ConsoleOutputDisabled: 0x20000 ///< Log output only done into the log file.\n};\n\n/**\n * @brief API objects types.\n */\nDMPConnect.HandleType = {\n /// Common handle types.\n HandleType_Undefined: 1,\n HandleType_List: 2,\n HandleType_Error: 3,\n\n /// Galss support handle types.\n HandleType_GalssResource: 4,\n HandleType_Galss: 5,\n HandleType_PcscResource: 107, // Since v.2.0.0\n HandleType_Pcsc: 108, // Since v.2.0.0\n\n /// Vitale support handle types.\n HandleType_Vitale: 6,\n HandleType_VitalePatient: 7,\n\n /// Common CPx & ES support handle types.\n HandleType_TimeProvider: 8,\n HandleType_HP: 9,\n HandleType_SubmissionSet: 10,\n HandleType_Document: 11,\n HandleType_Connection: 12,\n HandleType_DmpConnector: 13,\n HandleType_Certificate: 14,\n HandleType_PracticeLocation: 15,\n HandleType_EventCode: 19, // Since v.1.1.6.\n\n /// CPx support handle types.\n HandleType_CPx: 16,\n HandleType_CPxPkcsToken: 17,\n HandleType_Filter: 18\n};\n\n/**\n * @brief Global API parameters.\n *\n * Values can be retreived with:\n * - getParameterStringSize(), getParameterString() for strings parameters.\n * - getParameterInt() for integer, bool or D_HANDLE parameters.\n */\nDMPConnect.GlobalParameterName = {\n // String parameters.\n // -------------------------------------------\n VersionName: 1,\n\n PatientWebAccessPdfStoragePath: 2,\n PatientWebAccessPdfTemplateFilename: 3,\n PatientWebAccessPdfDefaultUrl: 4,\n CryptolibCpsDllFilename: 5, // Renamed in v2.0.0. Previous name \"Pkcs11ModulePath\".\n\n // Integer parameters.\n // -------------------------------------------\n VersionMajor: 6,\n VersionMinor: 7,\n VersionBuild: 8,\n\n // D_HANDLE parameters.\n // -------------------------------------------\n CurrentTimeProvider: 9, // Handle type: Time Provider.\n\n // Boolean parameters.\n // -------------------------------------------\n Pkcs11EngineIsInitialized: 10\n};\n\n/**\n * @brief Objects parameters.\n *\n * Values can be retreived with:\n * - getObjectParameterString(), getObjectParameterStringSize() for strings parameters.\n * - getObjectParameterInt() for integers, D_HANDLE, enums or boolean parameters.\n * - getObjectParameterFloat() for float parameters.\n */\nDMPConnect.ObjectParameterName = {\n // String parameters.\n // -------------------------------------------\n ErrorDescription: 1,\n ErrorContext: 2,\n ErrorExtendedInformations: 3,\n TimeProviderIp: 4,\n ConnectionUrl: 5,\n ConnectionProxyIp: 6,\n ConnectionProxyLogin: 7,\n ConnectionProxyPassword: 8,\n HpName: 9,\n HpGiven: 10,\n HpProfession: 11,\n HpProfessionOid: 12,\n HpProfessionDescription: 133,\n HpSpeciality: 13,\n HpSpecialityDescription: 134,\n HpInternalId: 14,\n PracticeLocationName: 15,\n PracticeLocationActivity: 16,\n PracticeLocationPracticeSettings: 17,\n PracticeLocationHealthcareSettings: 112, // Since v.2.2.1. Set if a compatible activity sector is found in a CPx card. Empty otherwise.\n DmpConnectorUniqueId: 18,\n DmpConnectorDumpPath: 19,\n DmpConnectorLocalPatientRootOid: 94, // Since v.1.1.4.\n DocumentUniqueId: 20,\n DocumentContent: 21,\n DocumentCreationDate: 48, // UTC date of the medical document creation. Available in ES mode since v.2.0.0.\n DocumentServiceStartDate: 49, // UTC date of the start of the medical act. Idem.\n DocumentServiceStopDate: 50, // UTC date of the end of the medical act. Idem.\n DocumentCda_CrBioSetIdRoot: 104, // Since v.1.5.1. Extra CDA metadata for \"Compte Rendu de Biologie\".\n DocumentCda_CrBioSetIdExtension: 105, // Since v.1.5.1. Idem.\n DocumentCda_CrBioVersionNumber: 106, // Since v.1.5.1. Idem.\n SubmissionSetTitle: 23,\n SubmissionSetDescription: 24,\n SubmissionSetLocalPatientId: 93, // Since v.1.1.4.\n EventCodeCode: 96, // Since v.1.1.6.\n EventCodeDescription: 97, // Since v.1.1.6.\n\n CertificateFilename: 25,\n CertificatePassPhrase: 26,\n\n GalssResourceName: 27,\n GalssFilename: 28,\n PcscResourceName: 109,\n\n VitaleApiLecFilename: 29,\n VitaleCurrentReaderName: 113, // Since v.2.0.0.\n VitaleXmlContent: 30,\n VitalePatientName: 31,\n VitalePatientBirthname: 32,\n VitalePatientGiven: 33,\n VitalePatientBirthday: 34, // Format: either YYMMDD or DDMMYYYY (since v2.0.0).\n VitalePatientIns: 35, // INS-C if any (see VitalePatientInsAvailable).\n VitalePatientXml: 36,\n VitalePatientNir: 37,\n VitalePatientCertifiedNir: 38,\n\n FilterCategoriesList: 39, // Filter categories list (';'-separated).\n FilterFormatsList: 40, // Filter formats list (';'-separated).\n FilterPracticesList: 41, // Filter practices list (';'-separated).\n FilterBottomCreationDate: 42,\n FilterTopCreationDate: 43,\n FilterBottomServiceStartDate: 44,\n FilterTopServiceStartDate: 45,\n FilterBottomSubmissionDate: 46,\n FilterTopSubmissionDate: 47,\n DocumentTitle: 51,\n DocumentDescription: 52,\n DocumentClassCode: 53,\n DocumentTypeCode: 54,\n DocumentHealthCareFacilityTypeCode: 55,\n DocumentPracticeSettingCode: 56,\n DocumentPatientIns: 58,\n DocumentHash: 59,\n DocumentXDSMetadata: 60,\n DocumentSubmissionDate: 61,\n DocumentUUId: 102, // Since v.1.2.5\n DocumentPreviousUUId: 62, // Renamed in v.1.2.5\n DocumentNextUUId: 63, // Renamed in v.1.2.5\n DocumentCDAContent: 103, // Since v.1.2.6\n CpxSerialNumber: 99, // Since v.1.2.0\n CpxReaderName: 110, // Since v.2.0.0\n CpxValidityDate: 111, // Since v.2.0.0\n\n // Integer parameters.\n // -------------------------------------------\n ErrorCode: 64,\n\n TimeProviderPort: 66,\n ConnectionTimeOut: 67,\n ConnectionProxyPort: 68,\n\n DocumentSize: 70,\n\n // Boolean parameters.\n // -------------------------------------------\n DocumentPdfFormatConversionEnabled: 71,\n\n VitalePatientInsAvailable: 72,\n\n // Float parameters.\n // -------------------------------------------\n TimeProviderSynchronizationDifference: 74,\n\n // D_HANDLE parameters.\n // -------------------------------------------\n ConnectionAuthenticationToken: 75, // Handle type: Certificate.\n ConnectionCaCertificate: 76, // Handle type: Certificate.\n DmpConnectorConnection: 77, // Handle type: Connection.\n DmpConnectorPracticeLocation: 78, // Handle type: Practice location.\n DmpConnectorUser: 79, // Handle type: HP.\n DocumentPerformer: 80, // Handle type: HP.\n DocumentAuthors: 81, // Handle type: List.\n DocumentEventCodes: 95, // Handle type: List. Added since 1.1.6.\n SubmissionSetDocuments: 82, // Handle type: List.\n\n PracticeLocationSignatureCertificate: 83, // Handle type: Certificate. ES mode only.\n\n // Enum parameters.\n // -------------------------------------------\n ErrorTypeCode: 65, // enum: ErrorType.\n\n GalssResourceEntryType: 84, // enum: GalssResourceType.\n GalssResourceEntryProtocol: 85, // enum: GalssResourceProtocol.\n\n EventCodeClassification: 98, // enum: EventCodeType. Since v.1.1.6.\n VitaleCardType: 101, // enum: CardDemoStatus. Since v.1.1.5. Real card or Demo card.\n HpAuthenticationMode: 86, // enum: UserAuthenticationMode.\n DocumentPerformerRole: 87, // enum: PerformerRole.\n\n CPxCardType: 100, // enum: CardDemoStatus. Since v.1.2.0. Real card or Demo card.\n CpxType: 69, // enum: CPxType.\n FilterDocumentStatus: 88, // enum: DocumentStatus.\n FilterDocumentVisibility: 89, // enum: DocumentVisibility.\n Document_Status: 90, // enum: DocumentStatus.\n Document_Visibility: 91, // enum: DocumentVisibility.\n Document_Format: 92 // enum: DocumentFormat.\n};\n\n/**\n * @brief CPx types: \"CPS\", \"CPF\", \"CPE\", \"CPA\" or \"CSA\".\n *\n * Only CPS or CPF cards can be used to get DMP documents.\n * See DMPConnect.ObjectParameterName.CpxType.\n *\n */\nDMPConnect.CPxType = {\n CPS: 1,\n CPF: 2,\n CPE: 3,\n CPA: 4\n};\n\n/**\n * @brief Type of CPx or Vitale card: real card or demonstration/dev card?\n * See See DMPConnect.ObjectParameterName.CPxCardType and DMPConnect.ObjectParameterName.VitaleCardType\n */\nDMPConnect.CardDemoStatus = {\n Real: 1,\n Demo: 2\n};\n\n/**\n * @brief Type of the identifier of the HP.\n *\n * These values are used for i_internalIdType or i_hpInternalIdType of HP structures ;\n * They can be defined for custom author ;\n * They are returned for all authors after a document search.\n */\nDMPConnect.IdentifierType = {\n // Patient identifier\n IdentifierType_PatientIns: 1,\n IdentifierType_PatientInsC: 2,\n // National identifier\n IdentifierType_NationalIdentifierRpps: 3,\n IdentifierType_NationalIdentifierAdeli: 4,\n IdentifierType_NationalIdentifierSirius: 5,\n IdentifierType_NationalIdentifierStudent: 6,\n // Internal identifier (ID is internal to a given structrure)\n // For id relative to a different structures of the current user:\n IdentifierType_InternalIdentifierAdeli: 7,\n IdentifierType_InternalIdentifierFiness: 8,\n IdentifierType_InternalIdentifierSiren: 9,\n IdentifierType_InternalIdentifierSiret: 10,\n IdentifierType_InternalIdentifierRpps: 11,\n // For id relative to the current structure:\n IdentifierType_InternalIdentifier: 12\n};\n\n// Type of informant.\nDMPConnect.InformantType = {\n InformantType_Informant: 1,\n InformantType_EmergencyContact: 2,\n InformantType_TrustedContact: 3,\n InformantType_Unknown: 4\n};\n\n// Relation between informant and patient.\nDMPConnect.InformantRelationType = {\n InformantRelationType_Mother: 1, ///< 'Mère'\n InformantRelationType_Father: 2, ///< 'Père'\n InformantRelationType_NaturalMother: 3, ///< 'Mère biologique'\n InformantRelationType_NaturalFather: 4, ///< 'Père biologique'\n InformantRelationType_StepMother: 5, ///< 'Belle-mère - épouse du père ou de la mère'\n InformantRelationType_StepFather: 6, ///< 'Beau-père - époux du père ou de la mère'\n InformantRelationType_GrandMother: 7, ///< 'Grand-mère'\n InformantRelationType_GrandFather: 8, ///< 'Grand-père'\n InformantRelationType_GrandGrandMother: 9, ///< 'Arrière-grand-mère'\n InformantRelationType_GrandGrandFather: 10, ///< 'Arrière-grand-père'\n InformantRelationType_NaturalDaughter: 11, ///< 'Fille-biologique'\n InformantRelationType_NaturalSon: 12, ///< 'Fils-biologique'\n InformantRelationType_Brother: 13, ///< 'Frere'\n InformantRelationType_Sister: 14, ///< 'Soeur'\n InformantRelationType_HalfBrother: 15, ///< 'Demi-frère'\n InformantRelationType_HalfSister: 16, ///< 'Demi-soeur'\n InformantRelationType_GrandDaughter: 17, ///< 'Petite-fille'\n InformantRelationType_GrandSon: 18, ///< 'Petit-fils'\n InformantRelationType_Uncle: 19, ///< 'Oncle'\n InformantRelationType_Aunt: 20, ///< 'Tante'\n InformantRelationType_Nephew: 21, ///< 'Neveu'\n InformantRelationType_Niece: 22, ///< 'Nièce'\n InformantRelationType_Husband: 23, ///< 'Mari'\n InformantRelationType_Wife: 24, ///< 'Femme'\n InformantRelationType_CivilUnion: 25, ///< 'concubin ou partenaire PACS'\n InformantRelationType_SameAddress: 26, ///< 'personne habitant sous le même toit'\n InformantRelationType_Friend: 27, ///< 'Autre Proche'\n InformantRelationType_Neighbor: 28, ///< 'Voisin'\n InformantRelationType_FamilyMember: 29, ///< 'Autre membre de la famille'\n InformantRelationType_Child: 30, ///< 'Enfant'\n InformantRelationType_Cousin: 31, ///< 'Cousin'\n InformantRelationType_Spouse: 32, ///< 'Coinjoint'\n InformantRelationType_Daughter: 33, ///< 'Fille'\n InformantRelationType_Son: 34, ///< 'Fils'\n InformantRelationType_Guardian: 35, ///< 'Tuteur'\n InformantRelationType_Curator: 36, ///< 'Curateur'\n InformantRelationType_Agent: 37, ///< 'Mandataire de sauvegarde'\n InformantRelationType_Unknown: 38\n};\n\n// Type of telecom\nDMPConnect.TelecomType = {\n TelecomType_Phone: 1,\n TelecomType_Fax: 2,\n TelecomType_Mail: 3,\n TelecomType_HTTP: 4,\n TelecomType_FTP: 5,\n TelecomType_MLLP: 6,\n TelecomType_Unknown: 7\n};\n\n// Usage of telecom\nDMPConnect.TelecomUsage = {\n TelecomUsage_Home: 1, ///< 'Domicile'\n TelecomUsage_MainHome: 2, ///< 'Domicile principal'\n TelecomUsage_Holiday: 4, ///< 'Lieu de vacances'\n TelecomUsage_Workplace: 8, ///< 'Lieu de travail'\n TelecomUsage_Direct: 16, ///< 'Numéro direct'\n TelecomUsage_Public: 32, ///< 'Numéro publique'\n TelecomUsage_Emergency: 64, ///< 'Numéro d'urgence'\n TelecomUsage_Mobile: 128, ///< 'Téléphone mobile'\n TelecomUsage_Pager: 256, ///< 'Beeper'\n TelecomUsage_Unknown: 512\n};\n\n// Kind of address\nDMPConnect.AddressType = {\n AddressType_Home: 1, ///< 'Domicile'\n AddressType_MainHome: 2, ///< 'Domicile principal'\n AddressType_Holiday: 3, ///< 'Domicile de vacances'\n AddressType_Workplace: 4, ///< 'Lieu de travail'\n AddressType_Temporary: 5, ///< 'Adresse temporaire'\n AddressType_Unknown: 6\n};\n\n// Street name type\nDMPConnect.StreetNameType = {\n StreetNameType_Alley: 1, ///< 'Allée'\n StreetNameType_Avenue: 2, ///< 'Avenue'\n StreetNameType_Boulevard: 3, ///< 'Boulevard'\n StreetNameType_Center: 4, ///< 'Centre'\n StreetNameType_CommercialCenter: 5, ///< 'Centre Commercial'\n StreetNameType_Building: 6, ///< 'Immeuble'\n StreetNameType_Impasse: 7, ///< 'Impasse'\n StreetNameType_Locality: 8, ///< 'Lieu dit'\n StreetNameType_Subdivision: 9, ///< 'Lotissement'\n StreetNameType_Passage: 10, ///< 'Passage'\n StreetNameType_Place: 11, ///< 'Place'\n StreetNameType_Residence: 12, ///< 'Residence'\n StreetNameType_Rundabout: 13, ///< 'Rond point'\n StreetNameType_Road: 14, ///< 'Route'\n StreetNameType_Street: 15, ///< 'Rue'\n StreetNameType_Square: 16, ///< 'Square'\n StreetNameType_Village: 17, ///< 'Village'\n StreetNameType_Area: 18, ///< 'Zone d'activité'\n StreetNameType_DevelopmentZone: 19, ///< 'Zone d'aménagement concerté'\n StreetNameType_HoldingZone: 20, ///< 'Zone d'aménagement différé'\n StreetNameType_IndustrialZone: 21, ///< 'Zone industrielle'\n StreetNameType_Unknown: 22\n};\n\n// Immunization type.\nDMPConnect.ImmunizationType = {\n ImmunizationType_Unknown: 1, ///< 'Vaccination sans autre précision'\n ImmunizationType_FirstSerie: 2, ///< '1ère série vaccinante'\n ImmunizationType_Booster: 3 ///< 'Rappel de vaccin'\n};\n\n// Immunization route of administration\nDMPConnect.ImmunizationRouteType = {\n ImmunizationRouteType_Unknown: 1,\n ImmunizationRouteType_IntramuscularInjection: 2, ///< 'Injection intramusculaire'\n ImmunizationRouteType_IntracutaneousInjection: 3, ///< 'Injection intradermique'\n ImmunizationRouteType_Inhalation: 4, ///< 'Par inhalation'\n ImmunizationRouteType_Oral: 5, ///< 'Prendre par la bouche'\n ImmunizationRouteType_SubcutaneousInjection: 6 ///< 'Injection sous-cutanée'\n};\n\n// Immunization approach site.\nDMPConnect.ImmunizationApproachSite = {\n ImmunizationApproachSite_Unknown: 1,\n ImmunizationApproachSite_Buttock: 2, ///< 'Fesse'\n ImmunizationApproachSite_LeftDeltoid: 3, ///< 'Deltoïde gauche'\n ImmunizationApproachSite_RightDeltoid: 4, ///< 'Deltoide droit'\n ImmunizationApproachSite_LeftThigh: 5, ///< 'Cuisse gauche'\n ImmunizationApproachSite_RightThigh: 6 ///< 'Cuisse droite'\n};\n\n// Structured body section type.\nDMPConnect.CDASectionType = {\n CDASectionType_Immunizations: 30\n};\n\n// Authority Identifier type\nDMPConnect.Hl7AuthorityIdentifierType = {\n Hl7AuthorityIdentifierType_Name: 1, // Identifier is a generic name.\n Hl7AuthorityIdentifierType_GeographicFiness: 2, // Identifier is a geographic FINESS.\n Hl7AuthorityIdentifierType_JuridicFiness: 3, // Identifier is a juridic FINESS.\n Hl7AuthorityIdentifierType_Iso: 4 // Identifier is an OID (Object Identifier) as defined in International Standard Organization.\n};\n\n// Identifier reliability\nDMPConnect.Hl7IdentityReliabilityCode = {\n Hl7IdentityReliability_Empty: 1, // 'Identité non encore qualifiée'\n Hl7IdentityReliability_Temporary: 2, // 'Provisoire'\n Hl7IdentityReliability_Valid: 3, // 'Validé'\n Hl7IdentityReliability_Slave: 4, // 'Doublon ou esclave'\n Hl7IdentityReliability_Disabled: 5, // 'Désactivé'\n Hl7IdentityReliability_PutativeDuplicate: 6, // 'Doublon potentiel'\n Hl7IdentityReliability_ProvedDuplicate: 7, // 'Doublon avéré'\n Hl7IdentityReliability_PutativeCollision: 8, // 'Collision potentielle'\n Hl7IdentityReliability_ValidatedCollision: 9, // 'Collision validée'\n Hl7IdentityReliability_Filiation: 10, // 'Filiation'\n Hl7IdentityReliability_Hidden: 11, // 'Cachée'\n Hl7IdentityReliability_Anonymous: 12, // 'Anonyme'\n Hl7IdentityReliability_CheckedPyPatient: 13, // 'Identité vérifiée par le patient'\n Hl7IdentityReliability_ReceivedFromAnotherDomain: 14, // 'Reçue d’un autre domaine'\n Hl7IdentityReliability_ClearedByAnotherDomain: 15, // 'Identité rapprochée dans un autre domaine'\n Hl7IdentityReliability_Theft: 16, // 'Usurpation'\n Hl7IdentityReliability_DetectedNamesake: 17, // 'Homonyme détecté'\n Hl7IdentityReliability_ProvedNamesake: 18, // 'Homonyme avéré'\n Hl7IdentityReliability_Invalid: 19, // 'Invalidation de l’identité'\n Hl7IdentityReliability_Fictional: 20, // 'Identité fictive'\n Hl7IdentityReliability_Doubtful: 21 // 'Identité douteuse'\n};\n","/*!\n * jQuery JavaScript Library v3.7.1\n * https://jquery.com/\n *\n * Copyright OpenJS Foundation and other contributors\n * Released under the MIT license\n * https://jquery.org/license\n *\n * Date: 2023-08-28T13:37Z\n */\n( function( global, factory ) {\n\n\t\"use strict\";\n\n\tif ( typeof module === \"object\" && typeof module.exports === \"object\" ) {\n\n\t\t// For CommonJS and CommonJS-like environments where a proper `window`\n\t\t// is present, execute the factory and get jQuery.\n\t\t// For environments that do not have a `window` with a `document`\n\t\t// (such as Node.js), expose a factory as module.exports.\n\t\t// This accentuates the need for the creation of a real `window`.\n\t\t// e.g. var jQuery = require(\"jquery\")(window);\n\t\t// See ticket trac-14549 for more info.\n\t\tmodule.exports = global.document ?\n\t\t\tfactory( global, true ) :\n\t\t\tfunction( w ) {\n\t\t\t\tif ( !w.document ) {\n\t\t\t\t\tthrow new Error( \"jQuery requires a window with a document\" );\n\t\t\t\t}\n\t\t\t\treturn factory( w );\n\t\t\t};\n\t} else {\n\t\tfactory( global );\n\t}\n\n// Pass this if window is not defined yet\n} )( typeof window !== \"undefined\" ? window : this, function( window, noGlobal ) {\n\n// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1\n// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode\n// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common\n// enough that all such attempts are guarded in a try block.\n\"use strict\";\n\nvar arr = [];\n\nvar getProto = Object.getPrototypeOf;\n\nvar slice = arr.slice;\n\nvar flat = arr.flat ? function( array ) {\n\treturn arr.flat.call( array );\n} : function( array ) {\n\treturn arr.concat.apply( [], array );\n};\n\n\nvar push = arr.push;\n\nvar indexOf = arr.indexOf;\n\nvar class2type = {};\n\nvar toString = class2type.toString;\n\nvar hasOwn = class2type.hasOwnProperty;\n\nvar fnToString = hasOwn.toString;\n\nvar ObjectFunctionString = fnToString.call( Object );\n\nvar support = {};\n\nvar isFunction = function isFunction( obj ) {\n\n\t\t// Support: Chrome <=57, Firefox <=52\n\t\t// In some browsers, typeof returns \"function\" for HTML