1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4011],{56882:function(e,t,r){r.d(t,{DK:function(){return n},XV:function(){return o}});let n=["42378152467528","58473920184651","90124567831234","71234589045678","35678901234567"];function o(e){let t=new Set(e.map(e=>e.toLowerCase()));return n.find(e=>!t.has(e.toLowerCase()))||function(e){let t=new Set(e.map(e=>e.toLowerCase()));for(let e=0;e<50;e+=1){let e="";for(let t=0;t<14;t+=1)e+=String(Math.floor(10*Math.random()));if(!t.has(e))return e}return String(Date.now()).slice(-14).padStart(14,"4")}(e)}},34011:function(e,t,r){r.d(t,{BU:function(){return f},createMockPrecisionBloodValue:function(){return w},getMockPrecisionBloodValues:function(){return l},rematchMockPrecisionBloodValue:function(){return D}});var n=r(56882);let o=new Map;function a(e){return"".concat("ever-precision-blood-values",":").concat(e)}function s(e){return"".concat("ever-precision-blood-values-unmatched",":").concat(e)}function c(e){var t;try{let t=window.sessionStorage.getItem(a(e)),r=window.sessionStorage.getItem(s(e)),n=t?JSON.parse(t):[],o=r?JSON.parse(r):[];return{entries:Array.isArray(n)?n:[],unmatchedBarcodes:Array.isArray(o)?o:[]}}catch(e){return{entries:[],unmatchedBarcodes:[]}}return null!==(t=o.get(e))&&void 0!==t?t:{entries:[],unmatchedBarcodes:[]}}function i(e,t){window.sessionStorage.setItem(a(e),JSON.stringify(t.entries)),window.sessionStorage.setItem(s(e),JSON.stringify(t.unmatchedBarcodes))}function u(e){return c(e).entries}function d(e,t){var r,n;return{id:"mock-bv-".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2,8)),patientId:e,caseId:null!==(r=t.caseId)&&void 0!==r?r:null,orderDate:t.orderDate,barcode:t.barcode.trim(),status:t.status,errorMessage:null!==(n=t.errorMessage)&&void 0!==n?n:null,createdAt:new Date().toISOString()}}function l(e){return u(e).sort((e,t)=>new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime())}function w(e,t){let r=t.barcode.trim(),n=u(e);if(n.some(e=>e.barcode.toLowerCase()===r.toLowerCase()))throw Error("BARCODE_DUPLICATE");let o=c(e),a=o.unmatchedBarcodes.filter(e=>e.toLowerCase()===r.toLowerCase()).length,s=d(e,{...t,status:a>0?"MATCHED":"PENDING"});return i(e,{entries:[s,...n],unmatchedBarcodes:o.unmatchedBarcodes.filter(e=>e.toLowerCase()!==r.toLowerCase())}),{entry:s,rematchedCount:a}}function f(e,t){let r=Date.now(),o=new Date(r-6048e5).toISOString(),a=[{...d(e,{orderDate:o,barcode:n.DK[0],caseId:t,status:"MATCHED"}),createdAt:new Date(r-3e5).toISOString()},{...d(e,{orderDate:o,barcode:n.DK[1],caseId:t,status:"PENDING"}),createdAt:new Date(r-24e4).toISOString()},{...d(e,{orderDate:o,barcode:n.DK[2],caseId:t,status:"PROCESSING"}),createdAt:new Date(r-18e4).toISOString()},{...d(e,{orderDate:o,barcode:n.DK[3],caseId:t,status:"UNMATCHED"}),createdAt:new Date(r-12e4).toISOString()},{...d(e,{orderDate:o,barcode:n.DK[4],caseId:t,status:"FAILED",errorMessage:null}),createdAt:new Date(r-6e4).toISOString()}];return i(e,{entries:a,unmatchedBarcodes:["11112222333344"]}),a}async function D(e,t){await new Promise(e=>setTimeout(e,900));let r=c(e),n=r.entries.findIndex(e=>e.id===t);if(-1===n)throw Error("ENTRY_NOT_FOUND");let o=r.entries[n];if("UNMATCHED"!==o.status&&"FAILED"!==o.status)throw Error("ENTRY_NOT_REMATCHABLE");let a=r.unmatchedBarcodes.some(e=>e.toLowerCase()===o.barcode.toLowerCase());if(!("UNMATCHED"===o.status||"FAILED"===o.status||a)){let t={...o,status:"FAILED",errorMessage:"Rematch could not link lab results to this patient."},a=[...r.entries];return a[n]=t,i(e,{...r,entries:a}),{success:!1,entry:t,message:t.errorMessage}}let s={...o,status:"MATCHED",errorMessage:null},u=[...r.entries];return u[n]=s,i(e,{entries:u,unmatchedBarcodes:r.unmatchedBarcodes.filter(e=>e.toLowerCase()!==o.barcode.toLowerCase())}),{success:!0,entry:s,message:null}}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.