Skip to content

Instantly share code, notes, and snippets.

<?xml version="1.0" encoding="utf-16"?>
<ShowPlanXML xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Version="1.518" Build="13.0.7050.2" xmlns="http://schemas.microsoft.com/sqlserver/2004/07/showplan">
<BatchSequence>
<Batch>
<Statements>
<StmtSimple StatementCompId="5" StatementEstRows="317954" StatementId="1" StatementOptmLevel="FULL" CardinalityEstimationModelVersion="130" StatementSubTreeCost="16005900" StatementText="WITH BaseOrderData AS (&#xD;&#xA; -- Initial data extraction&#xD;&#xA; SELECT&#xD;&#xA; OOM.OrderDateTime AS DatePrescribed,&#xD;&#xA; REPLACE(DRCustom.dbo.WhsPiece('|',1,OO2.StatusBoardDisplayString),'{','') AS MedicationName,&#xD;&#xA; OPD.PhaQuantity AS Quantity,&#xD;&#xA; OPD.PhaRefills AS NumberOfRefills,&#xD;&#xA; OPD.PharmacyNdcDinNumber AS NDCNumber,&#xD;&#xA; LOC.[Name] AS PharmacyName,&#xD;&#xA; COALESCE(MPN.NameWithCredentialsStored, OO2.OrderProvider, OOM.