### Creating DrChrono API Resources (e.g., Appointments) in Python Source: https://context7_llms This example demonstrates how to create new resources, such as an appointment, by sending a POST request to the relevant top-level API endpoint (e.g., '/api/appointments'). It includes the necessary data payload and verifies the successful creation using the HTTP 201 status code. ```Python import requests headers = { 'Authorization': 'Bearer ACCESS_TOKEN', } data = { 'doctor': 1234, 'duration': 30, # in minutes 'office': 3456, 'patient': 5678, 'scheduled_time': '2014-08-01T14:30:00' } url = 'https://drchrono.com/api/appointments' r = requests.post(url, data=data, headers=headers) assert r.status_code == 201 # HTTP 201 CREATED ``` -------------------------------- ### Initializing Application Tracer in JavaScript Source: https://app.drchrono.com/api-docs/v3/changelog This function initializes and configures a tracing mechanism within the application. It creates a tracer instance, registers various API calls for metrics and SPA events, and wraps function executions to emit start, error, and end events. It also instruments specific methods like actionText, setName, setAttribute, save, ignore, onEnd, getContext, end, get, and routeName for tracking. ```JavaScript function Fe(e){const t=e.ee.get("tracer");function r(){}p(u.dT,(function(e){return(new r).get("object"==typeof e?e:{})}),e);const i=r.prototype={createTracer:function(r,i){var o={},a=this,d="function"==typeof i;return(0,s.p)(h.xV,\["API/createTracer/called"],void 0,n.K7.metrics,e.ee),e.runSoftNavOverSpa||(0,s.p)(u.hw+"tracer",\[(0,c.t)(),r,o\],a,n.K7.spa,e.ee),function(){if(t.emit((d?"":"no-")+"fn-start",\[(0,c.t)(),a,d\],o),d)try{return i.apply(this,arguments)}catch(e){const r="string"==typeof e?new Error(e):e;throw t.emit("fn-err",\[arguments,this,r\],o),r}finally{t.emit("fn-end",\[(0,c.t)()\],o)}}}};["actionText","setName","setAttribute","save","ignore","onEnd","getContext","end","get"].forEach((t=>{p.apply(this,\[t,function(){return(0,s.p)(u.hw+t,\[(0,c.t)(),...arguments\],this,e.runSoftNavOverSpa?n.K7.softNav:n.K7.spa,e.ee),this},e,i])})),p(u.PA,(function(){e.runSoftNavOverSpa?(0,s.p)(u.hw+"routeName",\[performance.now(),...arguments\],void 0,n.K7.softNav,e.ee):(0,s.p)(u.Pl+"routeName",\[(0,c.t)(),...arguments\],this,n.K7.spa,e.ee)}),e)} ``` -------------------------------- ### Initializing The Trade Desk Universal Pixel (JavaScript) Source: https://www.drchrono.com/sitemap/ This JavaScript snippet executes a function when the DOM is ready, checking for the existence of the TTDUniversalPixelApi. If available, it initializes a new instance of the API and calls its 'init' method with specific client and pixel IDs, along with a tracking URL. This is commonly used for advertising and analytics tracking. ```JavaScript ttd_dom_ready( function() { if (typeof TTDUniversalPixelApi === 'function') { var universalPixelApi = new TTDUniversalPixelApi(); universalPixelApi.init("gtz9jiz", ["wznwo8p"], "https://insight.adsrvr.org/track/up"); } }); ``` -------------------------------- ### Initializing AJAX Instrumentation (JavaScript) Source: https://app.drchrono.com/api-docs/popup/v4/insurance_type_choices The constructor for the 'we' class (likely an AJAX feature class) initializes distributed tracing, sets up a handler for network events, and attempts to capture existing resource timing entries from 'performance.getEntriesByType('resource')' for XHR, Fetch, and Beacon requests, emitting them as 'xhr' events. It also calls 'le' and 'ne' functions, likely for event emitter setup. ```JavaScript class we extends T{static featureName=pe.T;constructor(e){super(e,pe.T),this.dt=new he(e),this.handler=(e,t,r,n)=>(0,s.p)(e,t,r,n,this.ee);try{const e={xmlhttprequest:"xhr",fetch:"fetch",beacon:"beacon"};y.gm?.performance?.getEntriesByType("resource").forEach((t=>{if(t.initiatorType in e&&0!==t.responseStatus){const r={status:t.responseStatus},i={rxSize:t.transferSize,duration:Math.floor(t.duration),cbTime:0};xe(r,t.name),this.handler("xhr",[r,i,t.startTime,t.responseEnd,e[t.initiatorType]],void 0,n.K7.ajax)}}))}catch(e){}le(this.ee),ne(this.ee)} ``` -------------------------------- ### Define Global Feature Flags JavaScript Source: https://www.drchrono.com/sitemap/ This snippet defines several global variables on the 'window' object. These variables act as feature flags or configuration settings, likely controlling UI elements or application behavior based on user account type or specific platform features (e.g., 'hermes', 'freemium', 'developer'). ```JavaScript window.free_account_type = ""; window.is_hermes = "" === "True" ? true : false; window.is_freemium = "" === "True" ? true : false; window.is_developer = "" === "True" ? true : false; ``` -------------------------------- ### Initialize Segment Analytics JavaScript Source: https://www.drchrono.com/sitemap/ This self-executing function initializes the Segment analytics library. It defines various tracking methods, handles duplicate snippet inclusion, loads the Segment script from CDN, and then calls analytics.load with a specific write key and integration settings, finally triggering a page event. ```JavaScript !function(){var analytics=window.analytics=window.analytics||[];if(!analytics.initialize)if(analytics.invoked)window.console&&console.error&&console.error("Segment snippet included twice.");else{analytics.invoked=!0;analytics.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","reset","group","track","ready","alias","debug","page","once","off","on"];analytics.factory=function(t){return function(){var e=Array.prototype.slice.call(arguments);e.unshift(t);analytics.push(e);return analytics}};for(var t=0;t{o=e}));const a=async()=>{let a;await this.deferred;try{if((0,w.V)(e.init)){const{setupAgentSession:t}=await i.e(478).then(i.bind(i,6526));a=t(e)}}catch(e){(0,l.R)(20,e),this.ee.emit("internal-error",[e]),this.featureName===n.K7.sessionReplay&&this.abortHandler?.()}try{if(!this.#t(this.featureName,a,e.init))return(0,m.Ze)(this.agentIdentifier,this.featureName),void o(!1);const{Aggregate:n}=await t();this.featAggregate=new n(e,r),e.runtime.harvester.initializedAggregates.push(this.featAggregate),o(!0)}catch(e){(0,l.R)(34,e),this.abortHandler?.(),(0,m.Ze)(this.agentIdentifier,this.featureName,!0),o(!1),this.ee&&this.ee.abort()}};y.RI?(0,b.GG)((()=>a()),!0):a()} ``` -------------------------------- ### Initializing Feature Aggregators in JavaScript Source: https://app.drchrono.com/api-docs/v3/changelog This snippet defines the constructor logic for a base feature class and its `importAggregator` method. It manages the deferred loading and initialization of feature-specific aggregation modules, handling auto-start configurations, error reporting, and session setup. It ensures that features like session replay or trace are only initialized if their prerequisites are met. ```javascript s.onAggregateImported=void 0,this.deferred=Promise.resolve(),!1===e.init[this.featureName].autoStart?this.deferred=new Promise(((t,r)=>{this.ee.on("manual-start-all",(0,x.J)((()=>{(0,m.Ak)(e.agentIdentifier,this.featureName),t()})))})):(0,m.Ak)(e.agentIdentifier,t)}importAggregator(e,t,r={}){if(this.featAggregate)return;let o;this.onAggregateImported=new Promise((e=>{o=e}));const a=async()=>{let a;await this.deferred;try{if((0,w.V)(e.init)){const{setupAgentSession:t}=await i.e(478).then(i.bind(i,6526));a=t(e)}}catch(e){(0,l.R)(20,e),this.ee.emit("internal-error",[e]),this.featureName===n.K7.sessionReplay&&this.abortHandler?.()}try{if(!this.#t(this.featureName,a,e.init))return(0,m.Ze)(this.agentIdentifier,this.featureName),void o(!1);const{Aggregate:n}=await t();this.featAggregate=new n(e,r),e.runtime.harvester.initializedAggregates.push(this.featAggregate),o(!0)}catch(e){(0,l.R)(34,e),this.abortHandler?.(),(0,m.Ze)(this.agentIdentifier,this.featureName,!0),o(!1),this.ee&&this.ee.abort()}};y.RI?(0,b.GG)((()=>a()),!0):a()}#t(e,t,r){switch(e){case n.K7.sessionReplay:return(0,R.SR)(r)&&!!t;case n.K7.sessionTrace:return!!t;default:return!0}} ``` -------------------------------- ### Instrumenting Fetch API - JavaScript Source: https://app.drchrono.com/api-docs/popup/v4/insurance_type_choices The `le` function instruments the browser's `fetch` API, including `Request` and `Response` body methods (`arrayBuffer`, `blob`, `json`, `text`, `formData`). It wraps these methods to emit "before-start", "start", and "end" events through an event emitter (`t`), allowing the monitoring agent to track fetch requests and their lifecycle, including capturing response size. ```JavaScript function le(e){const t=function(e){return(e||Q.ee).get("fetch")}(e);if(!(se&&ce&&y.gm.fetch))return t;if(de\[t.debugId\]++)return t;function r(e,r,n){var i=e\[r\];"function"==typeof i&&(e\[r\]=function(){var e,r=\[...arguments\],o={};t.emit(n+"before-start",\[r\],o),o\[Q.P\]&&o\[Q.P\].dt&&(e=o\[Q.P\].dt);var a=i.apply(this,r);return t.emit(n+"start",\[r,e\],a),a.then((function(e){return t.emit(n+"end",\[null,e\],a),e}),(function(e){throw t.emit(n+"end",\[e\],a),e}))})}return de\[t.debugId\]=1,ae.forEach((e=>{r(se\[ue\],e,oe),r(ce\[ue\],e,oe)})),r(y.gm,"fetch",ie),t.on(ie+"end",(function(e,r){var n=this;if(r){var i=r.headers.get("content-length");null!==i&&(n.rxSize=i),t.emit(ie+"done",\[null,r\],n)}else t.emit(ie+"done",\[e\],n)})),t} ``` -------------------------------- ### Instrumenting Fetch API (JavaScript) Source: https://app.drchrono.com/api-docs/v3/changelog The `le` function instruments the Fetch API, including `Request.prototype` and `Response.prototype` methods like `arrayBuffer`, `blob`, `json`, `text`, `formData`, and the global `fetch` function. It emits `before-start`, `start`, and `end` events for these operations, allowing the agent to track fetch requests, capture timing, and extract `content-length` from responses. ```JavaScript var ie="fetch-",oe=ie+"body-",ae=["arrayBuffer","blob","json","text","formData"],se=y.gm.Request,ce=y.gm.Response,ue="prototype";const de={};function le(e){const t=function(e){return(e||Q.ee).get("fetch")}(e);if(!(se&&ce&&y.gm.fetch))return t;if(de[t.debugId]++)return t;function r(e,r,n){var i=e[r];"function"==typeof i&&(e[r]=function(){var e,r=[...arguments],o={};t.emit(n+"before-start",[r],o),o[Q.P]&&o[Q.P].dt&&(e=o[Q.P].dt);var a=i.apply(this,r);return t.emit(n+"start",[r,e],a),a.then((function(e){return t.emit(n+"end",[null,e],a),e}),(function(e){throw t.emit(n+"end",[e],a),e}))})}return de[t.debugId]=1,ae.forEach((e=>{r(se[ue],e,oe),r(ce[ue],e,oe)})),r(y.gm,"fetch",ie),t.on(ie+"end",(function(e,r){var n=this;if(r){var i=r.headers.get("content-length");null!==i&&(n.rxSize=i),t.emit(ie+"done",[null,r],n)}else t.emit(ie+"done",[e],n)})),t} ``` -------------------------------- ### High-Resolution Performance Timestamp in JavaScript Source: https://app.drchrono.com/api-docs/popup/v4/insurance_type_choices This snippet exports a function `n` (aliased as `t`) that returns a high-resolution timestamp. It uses `performance.now()` to get the current time in milliseconds since the page started loading, rounded down to the nearest integer using `Math.floor()`. This is useful for precise timing measurements. ```JavaScript 1863:(e,t,r)=>{"use strict";function n(){return Math.floor(performance.now())}r.d(t,{t:()=>n})} ``` -------------------------------- ### Performance and User Action Feature Initialization in JavaScript Source: https://app.drchrono.com/api-docs/popup/v4/insurance_type_choices This class, `mt`, initializes features for capturing performance metrics (marks, measures, resources) and user actions. It checks agent configuration to enable or disable these features. It also sets up `PerformanceObserver` for resource timing and uses debouncing for user action events to optimize data collection. ```JavaScript var gt=i(3333);class mt extends T{static featureName=gt.TZ;constructor(e){super(e,gt.TZ);const t=[e.init.page_action.enabled,e.init.performance.capture_marks,e.init.performance.capture_measures,e.init.user_actions.enabled,e.init.performance.resources.enabled];var r;if(r=e,p(u.hG,((e,t)=>G(e,t,r)),r),function(e){p(u.fF,(function(){(0,s.p)(u.Pl+u.fF,[(0,c.t)(),...arguments],void 0,n.K7.genericEvents,e.ee)}),e)}(e),_e(e),V(e),function(e){p(u.V1,(function(t,r){const i=(0,c.t)(),{start:o,end:a,customAttributes:d}=r||{},f={customAttributes:d||{}};if("object"!=typeof f.customAttributes||"string"!=typeof t||0===t.length)return void(0,l.R)(57);const h=(e,t)=>null==e?t:"number"==typeof e?e:e instanceof PerformanceMark?e.startTime:Number.NaN;if(f.start=h(o,0),f.end=h(a,i),Number.isNaN(f.start)||Number.isNaN(f.end))(0,l.R)(57);else{if(f.duration=f.end-f.start,!(f.duration<0))return(0,s.p)(u.Pl+u.V1,[f,t],void 0,n.K7.genericEvents,e.ee),f;(0,l.R)(58)}}),e)}(e),y.RI&&(e.init.user_actions.enabled&&(gt.Zp.forEach((e=>(0,N.sp)(e,(e=>(0,s.p)("ua",[e],void 0,this.featureName,this.ee)),!0))),gt.qN.forEach((e=>{const t=(0,x.s)((e=>{(0,s.p)("ua",[e],void 0,this.featureName,this.ee)}),500,{leading:!0});(0,N.sp)(e,t)}))),e.init.performance.resources.enabled&&y.gm.PerformanceObserver?.supportedEntryTypes.includes("resource"))){new PerformanceObserver((e=>{e.getEntries().forEach((e=>{(0,s.p)("browserPerformance.resource",[e],void 0,this.featureName,this.ee)}))})).observe({type:"resource",buffered:!0})}t.some((e=>e))?this.importAggregator(e,(()=>i.e(478).then(i.bind(i,8019)))):this.deregisterDrain()}} ``` -------------------------------- ### DrChrono API Paginated GET Response Structure (JSON) Source: https://app.drchrono.com/api-docs-old/v4/documentation This JSON structure outlines the standard format for paginated responses from DrChrono API `GET` requests to an endpoint. It includes `next` and `previous` URLs for navigation between pages, and a `results` array containing the actual data objects. The `page_size` parameter can be used to control the number of results per page, defaulting to 250. ```JSON { "next": URL or null, // URL of the next page (same as the requested URL, but with the page query parameter incremented) "previous": URL or null, // URL of the previous page "results": array of result objects // the results follow the same format as ':endpoint/:id' } ``` -------------------------------- ### New Relic Agent Global Object and API Initialization in JavaScript Source: https://app.drchrono.com/api-docs/popup/v4/insurance_type_choices This extensive snippet manages the New Relic global `NREUM` object and preserves references to original browser APIs. Function `a` ensures `NREUM` exists. Function `s` stores original global functions like `setTimeout`, `XMLHttpRequest`, and `fetch`. Function `c` registers initialized agents. Function `u` sets properties on `NREUM`. Function `d` orchestrates the full initialization process, setting default beacon URLs and loader configurations. ```JavaScript const ``` -------------------------------- ### Retrieving Current User Information from DrChrono API in Python Source: https://context7_llms This snippet demonstrates how to fetch details about the currently authenticated user by making a GET request to the '/api/users/current' endpoint. It uses the obtained access token in the 'Authorization' header to authenticate the request and parses the JSON response. ```Python import requests response = requests.get('https://drchrono.com/api/users/current', headers={ 'Authorization': 'Bearer %s' % access_token, }) response.raise_for_status() data = response.json() # You can store this in your database along with the tokens username = data['username'] ``` -------------------------------- ### Initializing Tracer API in JavaScript Source: https://app.drchrono.com/api-docs/popup/v4/insurance_type_choices This function initializes a tracer API, providing methods like `createTracer`, `actionText`, `setName`, etc. It uses an event emitter (`e.ee`) for internal communication and metrics (`n.K7.metrics`, `n.K7.spa`, `n.K7.softNav`). It also instruments `createTracer` to emit `fn-start`, `fn-err`, and `fn-end` events, allowing for detailed tracking of function execution. ```JavaScript const t=e.ee.get("tracer"); function r(){} p(u.dT,(function(e){return(new r).get("object"==typeof e?e:{})}),e); const i=r.prototype={ createTracer:function(r,i){ var o={},a=this,d="function"==typeof i; return(0,s.p)(h.xV,["API/createTracer/called"],void 0,n.K7.metrics,e.ee), e.runSoftNavOverSpa||(0,s.p)(u.hw+"tracer",[(0,c.t)(),r,o],a,n.K7.spa,e.ee), function(){ if(t.emit((d?"":"no-")+"fn- ``` -------------------------------- ### Refreshing DrChrono API Access Token in Python Source: https://context7_llms This example illustrates how to use a refresh token to obtain a new access token without requiring the user to re-authorize. It sends a POST request to the token endpoint, replacing the 'code' parameter with 'refresh_token' and changing the 'grant_type' to 'refresh_token'. ```Python ... response = requests.post('https://drchrono.com/o/token/', data={ 'refresh_token': get_refresh_token(), 'grant_type': 'refresh_token', 'client_id': 'abcdefg12345', 'client_secret': 'abcdefg12345', }) ... ``` -------------------------------- ### Initializing New Relic Agent Configuration (JavaScript) Source: https://app.drchrono.com/api-docs/popup/v4/insurance_type_choices Sets up the initial configuration for the New Relic browser agent, including privacy settings, AJAX deny list, distributed tracing, and loader-specific details like agent, account, and license IDs. This configuration is crucial for the agent's operation and data reporting. ```JavaScript (window.NREUM||(NREUM={})).init={privacy:{cookies_enabled:true},ajax:{deny_list:["bam.nr-data.net"]},distributed_tracing:{enabled:true}}; (window.NREUM||(NREUM={})).loader_config={agentID:"491911",accountID:"109951",trustKey:"6279759",xpid:"VQYOWFNSGwcJVVhSAQ==",licenseKey:"cc010cc7dc",applicationID:"491906"}; ``` -------------------------------- ### Refreshing DrChrono Access Token (Python) Source: https://context7_llms This Python example illustrates how to use a refresh_token to obtain a new access_token when the current one expires. It sends a POST request to the token endpoint with grant_type set to refresh_token, the refresh_token itself, client_id, and client_secret. This avoids requiring the user to re-authorize the application. ```Python ... response = requests.post('https://drchrono.com/o/token/', data={ 'refresh_token': get_refresh_token(), 'grant_type': 'refresh_token', 'client_id': 'abcdefg12345', 'client_secret': 'abcdefg12345', }) ... ``` -------------------------------- ### Fetching Current User Information (Python) Source: https://context7_llms This Python snippet demonstrates how to make an authenticated GET request to the DrChrono API's /api/users/current endpoint to retrieve information about the currently logged-in user. It requires including the access_token in the Authorization header as a Bearer token. The response contains user details, such as the username, which can be stored. ```Python import requests response = requests.get('https://drchrono.com/api/users/current', headers={ 'Authorization': 'Bearer %s' % access_token, }) response.raise_for_status() data = response.json() # You can store this in your database along with the tokens username = data['username'] ``` -------------------------------- ### New Relic Browser Agent Core Initialization and Feature Runner Source: https://app.drchrono.com/api-docs/v3/changelog This anonymous class represents the core New Relic browser agent. Its constructor initializes the agent, sets up desired features based on configuration, and registers API methods for setting custom attributes, end-user IDs, and application versions. The `run` method iterates through enabled features, resolves dependencies, and instantiates each feature, handling potential errors during the process. It also manages soft navigation over SPA features. ```javascript new class extends r{constructor(e){var t;(super(),y.gm)?(this.features={},(0,S.bQ)(this.agentIdentifier,this),this.desiredFeatures=new Set(e.features||[]),this.desiredFeatures.add(E),this.runSoftNavOverSpa=[...this.desiredFeatures].some((e=>e.featureName===n.K7.softNav)),(0,a.j)(this,e,e.loaderType||"agent"),t=this,p(u.cD,(function(e,r,n=!1){if("string"==typeof e){if(["string","number","boolean"].includes(typeof r)||null===r)return g(t,e,r,u.cD,n);(0,l.R)(40,typeof r)}else(0,l.R)(39,typeof e)}),t),function(e){p(u.Dl,(function(t){if("string"==typeof t||null===t)return g(e,"enduser.id",t,u.Dl,!0);(0,l.R)(41,typeof t)}),e)}(this),function(e){p(u.nb,(function(t){if("string"==typeof t||null===t)return g(e,"application.version",t,u.nb,!1);(0,l.R)(42,typeof t)}),e)}(this),function(e){p(u.d3,(function(){e.ee.emit("manual-start-all")}),e)}(this),this.run()):(0,l.R)(21)}get config(){return{info:this.info,init:this.init,loader_config:this.loader_config,runtime:this.runtime}}get api(){return this}run(){try{const e=function(e){const t={};return o.forEach((r=>{t[r]=!!e[r]?.enabled})),t}(this.init),t=[...this.desiredFeatures];t.sort(((e,t)=>n.P3[e.featureName]-n.P3[t.featureName])),t.forEach((t=>{if(!e[t.featureName]&&t.featureName!==n.K7.pageViewEvent)return;if(this.runSoftNavOverSpa&&t.featureName===n.K7.spa)return;if(!this.runSoftNavOverSpa&&t.featureName===n.K7.softNav)return;const r=function(e){switch(e){case n.K7.ajax:return[n.K7.jserrors];case n.K7.sessionTrace:return[n.K7.ajax,n.K7.pageViewEvent];case n.K7.sessionReplay:return[n.K7.sessionTrace];case n.K7.pageViewTiming:return[n.K7.pageViewEvent];default:return[]}}(t.featureName).filter((e=>!(e in this.features)));r.length>0&&(0,l.R)(36,{targetFeature:t.featureName,missingDependencies:r}),this.features[t.featureName]=new t(this)}))}catch(e){(0,l.R)(22,e);for(const e in this.features)this.features[e].abortHandler?.();const t=(0,S.Zm)();delete t.initializedAgents[this.agentIdentifier]?.features,delete this.sharedAggregator;return t.ee.get(this.agentIdentifier).abort(),!1}}}({features:[we,E,P,He,Ke,I,z,mt,Rt,We,pt],loaderType:"spa"}) ``` -------------------------------- ### Initializing Browser Monitoring Feature - JavaScript Source: https://app.drchrono.com/api-docs/popup/v4/insurance_type_choices This class `z` extends `T` and serves as a core feature initializer for the browser monitoring agent. Its constructor sets up various error and unhandled rejection listeners on the global object (`y.gm`), registers internal error handlers, and manages an `AbortController` for cleanup. It also imports an aggregator module. ```JavaScript class z extends T{static featureName=j.T;constructor(e){var t;super(e,j.T),t=e,p(u.o5,((e,r)=>K(e,r,t)),t),function(e){p(u.bt,(function(t){e.runtime.onerror=t}),e)}(e),function(e){let t=0;p(u.k6,(function(e,r){++t>10||(this.runtime.releaseIds\[e.slice(-200)\]=(""+r).slice(-200))}),e)}(e),V(e);try{this.removeOnAbort=new AbortController}catch(e){}this.ee.on("internal-error",((t,r)=>{this.abortHandler&&(0,s.p)("ierr",\[L(t),(0,c.t)(),!0,{},e.runtime.isRecording,r\],void 0,this.featureName,this.ee)})),y.gm.addEventListener("unhandledrejection",(t=>{this.abortHandler&&(0,s.p)("err",\[H(t),(0,c.t)(),!1,{unhandledPromiseRejection:1},e.runtime.isRecording\],void 0,this.featureName,this.ee)}),(0,N.jT)(!1,this.removeOnAbort?.signal)),y.gm.addEventListener("error",(t=>{this.abortHandler&&(0,s.p)("err",\[M(t),(0,c.t)(),!1,{},e.runtime.isRecording\],void 0,this.featureName,this.ee)}),(0,N.jT)(!1,this.removeOnAbort?.signal)),this.abortHandler=this.#r,this.importAggregator(e,(()=>i.e(478).then(i.bind(i,5928))))}#r(){this.removeOnAbort?.abort(),this.abortHandler=void 0}} ``` -------------------------------- ### Managing Task Statuses API Endpoint - HTTP API Source: https://app.drchrono.com/api-docs-old/v4/documentation This endpoint allows retrieval, creation, and modification of task statuses. It requires the 'tasks' scope and supports GET, POST, PUT, and PATCH requests. No specific permissions are required, and practice group access is enabled. ```API Definition Filtering Parameters: - since (timestamp): Only retrieve task status updated after given timestamp - show_archived (boolean): If present when making a GET request without specifying an ID, archived results will be included. Not necessary when an ID is included in the URL. ``` ```API Definition Object Key/Values (Required POST/PUT): - archived (boolean, optional) - created_at (timestamp, read-only) - id (integer, read-only) - name (string, required) - practice_group (integer, read-only) - status_category (string, optional): Can be one of the following O(open), P(In progress), H(On hold), C(Complete), default to O(Open) - task_category (integer, optional): Id of task category - updated_at (timestamp, read-only) ``` -------------------------------- ### Managing Task Notes API Endpoint - HTTP API Source: https://app.drchrono.com/api-docs-old/v4/documentation This endpoint allows retrieval, creation, and modification of task notes. It requires the 'tasks' scope and supports GET, POST, PUT, and PATCH requests. No specific permissions are required, and practice group access is enabled. ```API Definition Filtering Parameters: - task (integer): Only retrieve task notes that associated with the given task - since (timestamp): Only retrieve task notes that are updated after the given timestamp ``` ```API Definition Object Key/Values (Required POST/PUT): - archived (boolean, No): Is this task note archived or not - created_at (timestamp, read-only) - created_by (integer, read-only): ID of /api/users that created the task note - id (integer, read-only) - task (integer, Yes): Associated /api/tasks item - text (string, Yes): Content of the task note - updated_at (timestamp, read-only) ``` -------------------------------- ### Managing Task Categories API Endpoint - HTTP API Source: https://app.drchrono.com/api-docs-old/v4/documentation This endpoint allows retrieval, creation, and modification of task categories. It requires the 'tasks' scope and supports GET, POST, PUT, and PATCH requests. No specific permissions are required, and practice group access is enabled. ```API Definition Filtering Parameters: - since (timestamp): Only retrieve task categories updated after the given timestamp - show_archived (boolean): If present when making a GET request without specifying an ID, archived results will be included. Not necessary when an ID is included in the URL. ``` ```API Definition Object Key/Values (Required POST/PUT): - archived (boolean, optional) - created_at (timestamp, read-only) - id (integer, read-only) - is_global (boolean, read-only) - name (boolean, required) - practice_group (integer, read-only) - updated_at (timestamp, read-only) ``` -------------------------------- ### Page Action and Performance Feature Initialization in JavaScript Source: https://app.drchrono.com/api-docs/popup/v4/insurance_type_choices This class, `pt`, extends a base `T` class and initializes various New Relic features related to page actions, performance, and error tracking. It sets up event listeners for URL changes (hashchange, pushState, replaceState, popstate, load), buffers events from different modules (tracer, events, jsonp, xhr, history, performance, mutation), and handles function errors. It also includes an `AbortController` for cleanup. ```JavaScript const{TZ:it,d3:ot,Kp:at,$p:st,wW:ct,e5:ut,tH:dt,uP:lt,rw:ft,Lc:ht}=Be;class pt extends T{static featureName=it;constructor(e){if(super(e,it),Fe(e),!y.RI)return;try{this.removeOnAbort=new AbortController}catch(e){}let t,r=0;const n=this.ee.get("tracer"),o=ze(this.ee),a=qe(this.ee),u=tt(this.ee),d=ne(this.ee),l=this.ee.get("events"),f=le(this.ee),h=Ee(this.ee),p=nt(this.ee);function g(e,t){h.emit("newURL",[""+window.location,t])}function m(){r++,t=window.location.hash,this[lt]=(0,c.t)()}function v(){r--,window.location.hash!==t&&g(0,!0);var e=(0,c.t)();this[ut]=~~this[ut]+e-this[lt],this[ht]=e}function b(e,t){e.on(t,(function(){this[t]=(0,c.t)()}))}this.ee.on(lt,m),a.on(ft,m),o.on(ft,m),this.ee.on(ht,v),a.on(ct,v),o.on(ct,v),this.ee.on("fn-err",((...t)=>{t[2]?.__newrelic?.[e.agentIdentifier]||(0,s.p)("function-err",[...t],void 0,this.featureName,this.ee)})),this.ee.buffer([lt,ht,"xhr-resolved"],this.featureName),l.buffer([lt],this.featureName),u.buffer(["setTimeout"+at,"clearTimeout"+ot,lt],this.featureName),d.buffer([lt,"new-xhr","send-xhr"+ot],this.featureName),f.buffer([dt+ot,dt+"-done",dt+st+ot,dt+st+at],this.featureName),h.buffer(["newURL"],this.featureName),p.buffer([lt],this.featureName),a.buffer(["propagate",ft,ct,"executor-err","resolve"+ot],this.featureName),n.buffer([lt,"no-"+lt],this.featureName),o.buffer(["new-jsonp","cb-start","jsonp-error","jsonp-end"],this.featureName),b(f,dt+ot),b(f,dt+"-done"),b(o,"new-jsonp"),b(o,"jsonp-end"),b(o,"cb-start"),h.on("pushState-end",g),h.on("replaceState-end",g),window.addEventListener("hashchange",g,(0,N.jT)(!0,this.removeOnAbort?.signal)),window.addEventListener("load",g,(0,N.jT)(!0,this.removeOnAbort?.signal)),window.addEventListener("popstate",(function(){g(0,r>1)}),(0,N.jT)(!0,this.removeOnAbort?.signal)),this.abortHandler=this.#r,this.importAggregator(e,(()=>i.e(478).then(i.bind(i,5592))))}#r(){this.removeOnAbort?.abort(),this.abortHandler=void 0}} ``` -------------------------------- ### New Relic Agent Configuration Object (NREUM.info) Source: https://app.drchrono.com/api-docs/v3/changelog This JavaScript snippet defines or extends the global `NREUM` object, specifically setting up the `NREUM.info` configuration. This object contains critical parameters for the New Relic agent, such as beacon and error beacon URLs, license key, application ID, and transaction name, which are essential for data transmission and identification. ```javascript window.NREUM||(NREUM={});NREUM.info={"beacon":"bam.nr-data.net","queueTime":1,"licenseKey":"cc010cc7dc","agent":"","transactionName":"NVFTMEQEVkBUAExdDAwbdxFYBkxaWg0XVRMLGkcNUxJLCXoTXVoiMn11C1UQVVZbF25dBhUaVgFC","applicationID":"491906","errorBeacon":"bam.nr-data.net","applicationTime":19} ``` -------------------------------- ### RUM Feature Constructor in JavaScript Source: https://app.drchrono.com/api-docs/popup/v4/insurance_type_choices Initializes the Real User Monitoring (RUM) feature, extending the base feature class. It sets up listeners for custom transaction events and 'api-send-rum' events, then imports the RUM aggregator. ```JavaScript class E extends T{static featureName=A.T;constructor(e){var t;super(e,A.T),t=e,p(u.Fw,(function(e,r){"string"==typeof e&&("/"!==e.charAt(0)&&(e="/"+e),t.runtime.customTransaction=(r||"http://custom.transaction")+e,(0,s.p)(u.Pl+u.Fw,[(0,c.t)()],void 0,void 0,t.ee))}),t),this.ee.on("api-send-rum",((e,t)=>(0,s.p)("send-rum",[e,t],void 0,this.featureName,this.ee))),this.importAggregator(e,(()=>i.e(478).then(i.bind(i,1983))))}} ```