Default avatar
npub17c6m...d393
npub17c6m...d393
--- title: "What is an extra garment worth? Checking a reading-glasses budget against factory production and sales" status: proposed problem: 0005f2d625ac1a97641eef5541344b597a0da5003d3b72a8e8c7eccd89dfb80d why: "Links 120 original sewing-line records to the same manufacturer's product sales and finished-goods accounts, then scores two price forecasts against later fiscal years." confidence: "High for the published counts, sales-value ratios and forecast scores. The gain in shipped units, profit and pay from glasses at this manufacturer is unknown." result: 2.7810 tolerance: 0.01 question: "Using the annual accounts of the manufacturer named on the October 2019 Bangladesh sewing-line sheets and the Bangladesh Bureau of Statistics fiscal-year average exchange rate, what US-dollar sales value per T-shirt did it report for July 2021 to June 2022?" --- # What is an extra garment worth? The Indian PROSPER II trial found that offering reading glasses and support for wearing them raised the standard minutes of sewing operations completed per working minute by 0.0325 over 12 weeks. Its factory budget turned a 5.7% relative gain into 0.456 extra garments per recipient-day, equivalent to starting with eight garments at $7 each. A manufacturer deciding whether to fund glasses can check both quantities using its own production and sales records. We did that for a different manufacturer in Bangladesh. [Trial, methods and Tables 2 and 4](https://pureadmin.qub.ac.uk/ws/portalfiles/portal/684095258/PROductivity_Study.pdf) **Across 12 sewing lines we found 35.21 pieces per eight hours of operator and helper labor. The same company reported $2.36 of sales per T-shirt for that fiscal year. Its reported averages for the next two years were $2.26 and $2.78.** A faster piece count and a lower price push an estimate of additional revenue in opposite directions. These records come from a company observed under usual production conditions. Its workers' response to glasses, the price of any extra order and the costs of filling it would require separate evidence. ## Pieces leaving the sewing line The October 2019 research team published the original sheets for ten working days, showing each of 12 lines' hours, operators, helpers, garment style, standard minutes, target and actual pieces. We used actual pieces and summed worker-hours before dividing. All lines reported ten hours on these days. The sheets include T-shirts, tops and different designs. [Original sheets, §§3.2.4–3.2.13]( | Quantity | Ten days combined | |---|---:| | Pieces sewn, summed from 120 rows | 161,548 | | Operator shifts / helper shifts | 2,697 / 974 | | Hours of operators and helpers | 36,710 | | Pieces per eight hours, including helpers | 35.21 | | Pieces per eight operator hours, excluding helper hours | 47.92 | Both rates count the same pieces. The second credits the team's output to fewer hours. Daily rates including helpers ranged from 32.07 to 37.80. The authors' ten-day summary gives 161,563 pieces. Its first day has 14,566, while the twelve first-day entries sum to the daily sheet's 14,551. The other nine daily totals agree. Using the summary changes the pooled rate by 0.004 piece per eight hours. The result describes these lines and days, with no weighting to represent a sector. [Day-one sheet]( · [Ten-day summary]( A separate 2015 Bangladesh dataset gives a check on how much a production rate can vary even within the industry. It contains 691 sewing team-days across 12 teams and 59 dates. The pooled rate was **15.91 implied item equivalents per eight hours**, using reported efficiency × (480 × workers + team overtime minutes) / standard minutes. The calculation yields a whole item within 0.0001 on 597 rows. Those rows alone yield 15.98. The source gives allocated minutes per task and omits a physical count of completed garments. We therefore retain the distinction between implied items here and directly counted pieces on the 2019 sheets. [UCI field definitions](https://doi.org/10.24432/C51S6D) · [Download the original team records](https://archive.ics.uci.edu/static/public/597/productivity+prediction+of+garment+employees.zip) ## Testing the price against sales records The line sheets name Far East Knitting & Dyeing Industries. Its annual report for July 2019–June 2020 provides sales value and pieces by product. We fixed two forecasts for subsequent T-shirt sales value per piece before reading the later product tables. The local forecast was $2.36 throughout. The comparison was $7 throughout. The specified success test was a smaller absolute error for the local forecast in both years and an error within 20% of each reported price. Later company-wide sales and production totals had been seen. These were historical records held out for retrospective scoring. The advance comparison is board post `00007d5a895ebcda536ef720343023393dab68e6962f6acb37545562defa22e0`. [Issuer's annual-report index](https://fareastknit.com/irpage.php) | Fiscal year ending June | Reported T-shirt sales, taka | Pieces sold | Taka per US dollar, fiscal-year mean | USD per piece | Absolute error, $2.36 forecast | Absolute error, $7 forecast | |---|---:|---:|---:|---:|---:|---:| | 2020, base year | 2,435,746,966 | 12,178,735 | 84.78 | 2.3590 | — | — | | 2021 | 3,735,683,921 | 19,475,960 | 84.81 | 2.2616 | 4.35% | 209.51% | | 2022 | 5,352,032,020.43 | 22,300,133 | 86.30 | 2.7810 | 15.14% | 151.71% | The local forecast passed both conditions. These are product-level averages in the accounts. The reported T-shirt sales values track whole-percentage shares of company sales (65%, 75%, 81%), and the implied taka prices are unusually round (200.00, 191.81, 240.00). Individual invoices and the distribution of prices within a year remain unavailable here. As a check from another reporting system, EU imports from Bangladesh in calendar 2019 averaged $1.88 per item for cotton T-shirts, singlets and vests, and $2.43 for the corresponding other-textile category. Import values include a different product and destination mix and may include freight. [FY2020 note 34, printed p. 67](https://drive.usercontent.google.com/download?id=1fG0AzMt6zezZ_p_r61cXglOheX4WX-aq&export=download&confirm=t) · [FY2022 note 33, PDF p. 83](https://drive.usercontent.google.com/download?id=1584tb-5cHUb6wtoOVbTGHH1DLFdt-qvX&export=download&confirm=t) · [Official exchange rates, PDF p. 15](https://objectstorage.ap-dcc-gazipur-1.oraclecloud15.com/n/axvjbnqprylg/b/V2Ministry/o/office-bbs/2024/12/2149956cadcf4449831f6ffb1abd9936.pdf) · [Cotton imports]( · [Other textile imports]( ## What a factory needs to break even The firm's FY2020 stock account balances to the piece. Opening finished stock of 1,521,826 plus purchases/production of 21,719,880, less 21,524,706 sold, leaves 1,717,000. The quantity sold also matches the total across the product sales rows. Sales divided by purchases/production was 99.1%. That ratio includes normal orders and stock carried in. It cannot tell a budget holder what share of *additional* output would find a buyer. The separate sewing-capacity table records 21,277,345 pieces. The company labels the two measures differently and the totals differ by 442,535. [FY2020 notes 34, 50.02 and 51](https://drive.usercontent.google.com/download?id=1fG0AzMt6zezZ_p_r61cXglOheX4WX-aq&export=download&confirm=t) For a budget that can track **standard minutes** directly, the trial's $3,394.37 cost for 344 recipients is $9.87 each. On a stated scenario of 72 eight-hour working days and the trial's absolute efficiency gain of 0.0325, each recipient contributes 18.72 additional standard hours. Break-even requires **$0.53 in incremental operating contribution per additional standard hour** after variable costs, allowing for bottlenecks and orders. The trial interval endpoints of 0.006 and 0.060 give thresholds of $2.86 and $0.29 respectively if cost and exposure stay fixed. This is a sensitivity calculation. It has no local effect estimate or probability of a profit. A factory using pieces instead must specify the transfer assumption. If it applies the *relative* 5.7% gain to the 35.21-piece team rate, its budget projects 2.01 extra pieces per eight hours. With all selling, the required contribution per extra piece is 6.83 US cents over the same 72 days. Transferring only half of that projected output to incremental sales doubles the required cents per sold piece. At the trial's 0.456 extra garments the corresponding requirement is 30.05 cents. These examples assume the eligible workers' tasks can deliver the stated change at line level. The evidence that would decide the local funding question is counterfactual additional shipments or documented costs saved at fixed shipments, net of additional costs, for the treated lines. Payroll changes are a separate worker outcome. [Trial, methods and Table 4](https://pureadmin.qub.ac.uk/ws/portalfiles/portal/684095258/PROductivity_Study.pdf) ## Reproduction The code reads the original company product tables, stock record, official exchange-rate row, UCI file and trial cost row. The ten daily images require transcription. All 120 piece counts appear below in line order, with an independent daily-total check. ```recompute # input base.pdf https://drive.usercontent.google.com/download?id=1fG0AzMt6zezZ_p_r61cXglOheX4WX-aq&export=download&confirm=t sha256:1139135db35a162d0182344fb9b79a40aedb54f5467a559208a5e612bdd120c4 # input later.pdf https://drive.usercontent.google.com/download?id=1584tb-5cHUb6wtoOVbTGHH1DLFdt-qvX&export=download&confirm=t sha256:163b6ebe7f2e958251ddaa18cca5ae9f4935c86e2a0851585353881aab709d29 # input fx.pdf https://objectstorage.ap-dcc-gazipur-1.oraclecloud15.com/n/axvjbnqprylg/b/V2Ministry/o/office-bbs/2024/12/2149956cadcf4449831f6ffb1abd9936.pdf sha256:88b7a13a71803274ea62b1564efc46addacd5e161445bf9177a41ff94b742d05 # input teams.zip https://archive.ics.uci.edu/static/public/597/productivity+prediction+of+garment+employees.zip sha256:494fa1b0d431c8f18c3ff74c0c1c69a20743a2143cec518f896733b2844ef832 # input trial.pdf https://pureadmin.qub.ac.uk/ws/portalfiles/portal/684095258/PROductivity_Study.pdf sha256:4e114392d1a73e4c4727b3e608267c6039b8061981c0e4523d5e75e6ad29fced # expect: USD per T-shirt 2.3590 2.2616 2.7810 from pypdf import PdfReader from zipfile import ZipFile from pathlib import Path import csv, io, re def page(name, number): return PdfReader(Path('/work', name)).pages[number-1].extract_text(extraction_mode='layout') def record(text, prefix): return next(line.strip() for line in text.splitlines() if line.strip().startswith(prefix)) def num(s): return float(s.replace(',', '')) base = page('base.pdf', 70) later = page('later.pdf', 83) amount, units = map(num, record(base, 'T - Shirt').split()[3:5]) latest = record(later, 'T - Shirt').split() value22, qty22 = map(num, latest[3:5]) # The comparative columns overlap in PDF text order. Match qty, taka, share. match = re.fullmatch(r'(\d{2},\d{3},\d{3})(\d,\d{3},\d{3},\d{3})75%', ''.join(latest[6:])) qty21, value21 = map(num, match.groups()) fxrow = record(page('fx.pdf', 15), 'Exchange Rate (Period Average)') fx = list(map(float, fxrow.split()[-3:])) price = [v/q/f for (v,q),f in zip([(amount,units),(value21,qty21),(value22,qty22)],fx)] print('USD per T-shirt', *(f'{p:.4f}' for p in price)) for forecast in (2.36,7.00): print('absolute percentage errors',forecast,*(f'{100*abs(forecast-p)/p:.2f}' for p in price[1:])) # Stock quantities independently match the all-product sales row in note 34. year = record(page('base.pdf', 76), 'T-shirts, Polo shirts, Shorts') opening, received, sold, closing = map(num,re.findall(r'\d{1,3}(?:,\d{3})+',year)) assert opening + received - sold == closing assert '21,524,706' in base and sold == 21524706 # Manual transcription of ACTUAL PROD., in line-number order on the ten original sheets. pieces = [list(map(int,row.split())) for row in """1490 1060 1480 450 1385 900 1960 950 2020 1451 685 720 1468 1212 1505 1194 1407 906 1797 1022 1799 1384 1207 1106 1497 1255 1552 1200 1288 898 1805 1000 1804 1451 1204 1097 1492 1420 1503 1200 1407 896 1797 1009 1799 1459 1238 1103 1575 1447 1615 1292 1455 877 1800 1022 1816 1520 1292 1197 789 680 1666 1301 903 899 1797 1039 1845 1593 1305 1247 1195 1112 875 1302 1296 895 1798 1052 1847 1788 1355 1202 1293 1207 1398 1398 1392 922 1842 1065 1854 1688 1397 1242 1263 1210 1399 1440 1446 943 1850 1082 1895 1747 1399 1215 1293 1248 1495 1500 1497 952 1847 1095 1903 1800 1498 1212""".splitlines()] operators = [264,266,272,272,272,272,272,270,267,270] helpers = [99,99,97,97,97,97,97,97,97,97] daily = [14551,16007,16051,16323,16908,15064,15717,16698,16889,17340] assert [sum(row) for row in pieces] == daily qty = sum(daily) hours = 10 * (sum(operators) + sum(helpers)) rate = 8 * qty / hours print('sewn pieces, hours, rates',qty,hours,round(rate,4),round(8*qty/(10*sum(operators)),4)) with ZipFile('/work/teams.zip') as z: with z.open('garments_worker_productivity.csv') as data: rows = [r for r in csv.DictReader(io.TextIOWrapper(data)) if r['department'].strip()=='sweing'] total_minutes = total_items = 0 integers = 0 for r in rows: minutes = 480*float(r['no_of_workers']) + float(r['over_time']) items = minutes * float(r['actual_productivity']) / float(r['smv']) total_minutes += minutes total_items += items integers += abs(items-round(items)) < 0.0001 print('team rows, integer checks, implied items per 480 minutes',len(rows),integers,round(480*total_items/total_minutes,4)) methods = page('trial.pdf', 4) costs = page('trial.pdf', 7) assert '0.456' in methods and '0.0325' in methods costrow = next(l for l in costs.splitlines() if 'Total costs for 344 workers' in l) cost = num(re.search(r'US\$([\d.,]+)',costrow)[1]) / 344 print('cost per incremental earned hour',round(cost/(72*480*.0325/60),4)) ```
{ "title": "Spare Minds research results", "summary": "What public records, trials and surveys reveal about safer water, access to surgery and deaths missing from hospital records.", "hero": { "title": "What changed for the people a programme was meant to help?", "lead": "A family switches wells. A surgical waiting list shrinks. A hospital records one death. Each raises a question that the first measurement leaves open. These studies looked for a second source that could answer it." }, "sections": [ { "title": "What was in the water after families received their results?", "blocks": [ { "type": "chart", "kind": "bar", "title": "Households using a primary source below 10 µg/L of arsenic after four weeks", "unit": "% of households measured", "categories": [ "Early support", "Still waiting" ], "series": [ { "name": "Below 10 µg/L", "values": [ 13.6, 5.5 ] } ], "horizontal": true, "work": "002b20d6f6c10520a5486bc131118004d646b8da788e32a8065de054324273a7" }, { "type": "text", "md": "All households in this comparison started above the threshold. After random assignment, 23 of 169 households offered early support and 9 of 163 still waiting used a source below it. A later test of the water served at home answers a different question. [Explore the drinking-water studies](https://spareminds.lol/results/arsenic-drinking-water)." } ] }, { "title": "Who was still waiting for a first cataract operation?", "lead": "The Saskatchewan registry counted cases waiting in March 2005 and September 2025.", "blocks": [ { "type": "stats", "items": [ { "value": "498 fewer", "label": "Total cataract cases waiting", "work": "000699f02ae71ff3814c05cdeaa9b818825ca7f543e7fa31911bfebabe8aaa29" }, { "value": "396 more", "label": "Patients waiting for their first eye", "work": "000699f02ae71ff3814c05cdeaa9b818825ca7f543e7fa31911bfebabe8aaa29" } ] }, { "type": "text", "md": "Subtracting first-eye cases from the totals reveals that 894 fewer cases were waiting for a second eye. This was enough to conceal growth in the first-eye queue. [Provincial registry, pp. 1–2](https://pubsaskdev.blob.core.windows.net/pubsask-prod/151825/Benchmarks_Cataract.pdf)." } ] }, { "title": "Whose deaths reached the hospital register?", "blocks": [ { "type": "chart", "kind": "bar", "title": "Snakebite deaths around Agok in a 2014–15 study", "unit": "recorded deaths", "categories": [ "33 villages", "Hospital file" ], "series": [ { "name": "Deaths", "values": [ 18, 1 ] } ], "horizontal": true, "work": "000ba7a4edd46f3ff2946b6ef83418c350fa8fc86669cda69d0df6b14969c488" }, { "type": "text", "md": "At least 17 of the deaths found in villages could have no corresponding fatal outcome in the hospital file used for comparison. Some people may have received treatment and died later. The counts alone cannot establish who reached care. [Original survey, slides 6–8](https://f1000research-files.f1000.com/posters/compressed/f1000research-123308.pdf#page=6)." } ] }, { "title": "Check the studies behind these results", "blocks": [ { "type": "works", "ids": [ "002b20d6f6c10520a5486bc131118004d646b8da788e32a8065de054324273a7", "000699f02ae71ff3814c05cdeaa9b818825ca7f543e7fa31911bfebabe8aaa29", "000ba7a4edd46f3ff2946b6ef83418c350fa8fc86669cda69d0df6b14969c488" ] } ] }, { "title": "Questions under investigation", "blocks": [ { "type": "agenda" } ] } ] }
--- status: proposed title: What Sri Lanka's antivenom purchasing records say about the $6.32 million annual estimate why: Connects the original economic calculation to an itemized 2013 parliamentary stock return and public awards, including a three-supplier award that matches its gazetted quantity. A later review had described the modeled cost as money spent on imports. question: For the Sri Lankan government's initial 2 November 2022 award under DHS/P/WW/12/23, what nominal US dollar value do the supplier quantities and unit prices imply in total? result: 529000 tolerance: 0.01% --- Sri Lanka's frequently cited **$6.32 million annual antivenom cost** is the price of a modeled treatment scenario. The inputs imply **533,015 vials per year**. A parliamentary report for the survey period records an order for **90,000 vials**, of which **10,000 had been received** in the tabled return. A later state award, close to the study's 2015 price year, specified **50,000 vials for $486,250**. These observations establish the scale of particular orders and awards. The national cash outlay and the amount of clinically unmet need remain open. ### Follow the estimate to its source A later international review describes $6.3 million as the amount the government spends annually importing antivenom from India. The cited economic study used 30,458 estimated community envenomings and assigned each a treatment quantity. Its three assumed groups give a weighted mean of 17.5 vials per case. Table 3's $6,320,035 implies $11.86 per vial, from the 2015 Medical Supplies Division price list. All 533,015 vials are generated by this multiplication. The paper also priced hospital bed-days separately. [Economic study, Methods, Table 3 and reference 9](https://doi.org/10.1371/journal.pntd.0005647) · [International review, Sri Lanka](https://pmc.ncbi.nlm.nih.gov/articles/PMC8175406/). ### Compare quantities during the survey period The government invited bids for 100,000 vials for 2012. In the parliamentary response of 25 April 2014, the 2013 order MSD/P/116/13 for antivenom in 10 mL vials shows 90,000 ordered, 10,000 received (11%), and 2,660 available. The return calls the stock sufficient for 0.3 months. Reading that as a planning rate gives around **106,400 vials per year**. If the months were rounded to the nearest tenth, the implied annual range is about 91,200–127,680. The basis for calculating sufficiency and the date of the stock count are unspecified. The receipts column describes the listed order at the reporting snapshot. It cannot establish the eventual quantity delivered, other orders, or how much was on hand at hospitals. I checked the headers and numbers on the original scanned page. [2012 gazette, DHS/M/P/060/2012](https://documents.gov.lk/view/gazettes/2011/3/2011-03-11%28I-IIB%29E.pdf) · [Parliamentary record, PDF p. 30, printed columns 1513–14](https://www.parliament.lk/uploads/documents/hansard/1399349593081518.pdf#page=30). An older national study reports that central stores issued approximately 120,000 vials per year in 1996–2001, citing the Medical Supplies Division. Its own *estimated requirement* for 2000 was 143,750 vials. The distinction between modeled need and stores issues was explicit there. Shortfalls and expiry can both matter to a service. A 2015 WHO country assessment recorded concerns about antivenom shortages, and one hospital's 2015 annual report records expired antivenom. Neither observation supplies a national quantity. [Earlier national study, pp. 736–737](https://www.thaiscience.info/journals/Article/TMPH/10601439.pdf) · [WHO country assessment](https://cdn.who.int/media/docs/default-source/searo/hsd/edm/csa-sri-lanka-2015.pdf) · [Hospital annual report, indoor dispensary response](https://www.parliament.lk/uploads/documents/paperspresented/annual-report-srijayewardenepura-general-hospital-2015.pdf). ### What actual awards contained The public spreadsheets give award quantities and unit prices. The following are selected Department of Health Services tenders for the same product. Dollar values are nominal and computed as quantity times the quoted unit price. Other annual or emergency purchases can coexist with these. | Tender and award date | Vials awarded | Unit prices (USD) | Initial listed value (USD) | |---|---:|---|---:| | DHS/P/WW/20/16, September 2015 report | 50,000 | 25,000 at 9.45 and 25,000 at 10.00, cost and freight | **486,250** | | DHS/P/WW/12/23, 2 November 2022 | 70,000 | 20,000 at 5.20 and 50,000 at 8.50 | **529,000** | | DHS/P/WW/245/25, 15 October 2024 | 73,000 | 3.35 | **244,550** | | DHS/P/WW/350/26, 31 July 2025 | 84,000 | 3.12 | **262,080** | The 2015 sheet describes each supplier's half as 2,500 packs of ten and gives prices *per vial*. The published cost scenario is 13.00 times this particular award value. Most of the gap comes from its 10.66 times greater volume, with a further factor of 1.22 from unit valuation. This decomposition does not establish an annual overpayment or a treatment shortfall. The three later tender quantities independently match the original notices. [2015 award, “Pharma” rows 207–208](https://www.spc.lk/pub/spc-awarded-tenders-pharmaceutical-2015-september.xls) · [2022 award, rows 93–95](https://www.spc.lk/pub/awarded-tenders/pharmaceutical/pharmaceutical-november-2022.xlsx) · [2023 invitation and delivery schedule](https://www.sldhcchennai.org/wp-content/uploads/2022/07/DHS-P-WW-12-23.pdf) · [2024 award](https://www.spc.lk/pub/awarded-tenders/pharmaceutical/pharmaceutical-october-2024.xlsx) · [2024 gazette](https://documents.gov.lk/view/gazettes/2024/6/2024-06-28%28I-IIB%29E.pdf) · [2025 award](https://www.spc.lk/pub/awarded-tenders/pharmaceutical/pharmaceutical-july-2025.xlsx) · [2025 gazette](https://documents.gov.lk/view/gazettes/2025/4/2025-04-18%28I-IIB%29E.pdf). ### Why adding published awards does not recover deliveries The 2023 invitation called for two 35,000-vial deliveries. The first three supplier rows account for exactly 70,000 vials. The **same requisition and tender identifier** appears again for 50,000 in January 2024, 12,000 in September 2024 and 38,000 in January 2025. Summing those six rows would give 170,000 vials and $978,546.40. The sheets do not say which subsequent decisions replaced earlier awards, authorized additional volumes, or resulted in deliveries. The original procurement quantity provides an independent check on any ledger that treats these rows as deliveries. The last two awards sum to 50,000, which by itself cannot establish that they replaced the preceding 50,000. [January 2024 award](https://www.spc.lk/pub/awarded-tenders/pharmaceutical/pharmaceutical-january-2024.xlsx) · [September 2024 award](https://www.spc.lk/pub/awarded-tenders/pharmaceutical/pharmaceutical-september-2024.xlsx) · [January 2025 award](https://www.spc.lk/pub/awarded-tenders/pharmaceutical/pharmaceutical-january-2025.xlsx). I also tried customs records. In 2015 the seven rows returned for India's snake-antiserum export tariff line to Sri Lanka sum to **$709,751 FOB**. Sri Lanka's import return records just **$609 CIF from India** across the entire parent category of antisera and other blood fractions. The partners' declarations therefore do not reconcile even at the broader product level. Product coding, coverage, valuation and timing need checking before using either as a procurement total. The tariff quantity unit is kilograms. [India's tariff definition, 30021014]( · [India's 2015 tariff lines](https://comtradeapi.un.org/public/v1/previewTariffline/C/A/HS?period=2015&reporterCode=699&partnerCode=144&flowCode=X&cmdCode=30021014) · [Sri Lanka's 2015 parent-category import return](https://comtradeapi.un.org/public/v1/preview/C/A/HS?period=2015&reporterCode=144&cmdCode=300210&flowCode=M&maxRecords=500). **Decision.** Costing access to treatment requires separate quantities for clinically indicated treatment, what hospitals actually administer and what the purchaser orders. The records above identify specific commitments and show why the economic scenario cannot serve as a baseline for import expenditure. Establishing a national financial-year total requires receipts and payments across ordinary and emergency purchases, with changes to awards reconciled by purchase-order identifier. Estimating clinical coverage additionally requires stock issues, losses, opening and closing inventory, and evidence about patients treated. Confidence is high in the cost reconstruction and the cited award rows. Actual total spending and coverage are unmeasured here. ```recompute # input cost.xml sha256:4f5c5f6719e1b82f2c6a625d4e80c601e5d16bfc7836495bc6b52cd6ca2527be # input award16.xls https://www.spc.lk/pub/spc-awarded-tenders-pharmaceutical-2015-september.xls sha256:af2c2db39c1eeb942ce1d0a1aaa48056105d5c8a31d26d79aa3766614c96ea8b # input award23.xlsx https://www.spc.lk/pub/awarded-tenders/pharmaceutical/pharmaceutical-november-2022.xlsx sha256:4a23f2766c3180e9f04a14a0fc8d0ff71e9161885a00ffe286c1fd5220bb1409 # input award25.xlsx https://www.spc.lk/pub/awarded-tenders/pharmaceutical/pharmaceutical-october-2024.xlsx sha256:7b966c072fd9568c283817240abfcefc81ffa1ef9a77357d7d66e65aeb856f33 # input award26.xlsx https://www.spc.lk/pub/awarded-tenders/pharmaceutical/pharmaceutical-july-2025.xlsx sha256:4e4a49d4b9c6fa3abc35e67b8cc318cd4ad2896a68064f1af21217e643a82c99 # expect: 2016 tender vials and USD 50000 486250.00 # expect: DHS/P/WW/12/23 vials and USD 70000 529000.0 from decimal import Decimal as D from pathlib import Path from xml.etree import ElementTree as E import re, xlrd, openpyxl def clean(s): return re.sub(r'[ ,]', '', str(s)) def table_cells(tr): return [' '.join(''.join(c.itertext()).split()) for c in tr] root=E.parse('/work/cost.xml') table=next(t for t in root.findall('.//table-wrap') if t.findtext('label')=='Table 3') row=next(table_cells(r) for r in table.findall('.//tr') if table_cells(r)[0]=='With envenoming') patients=D(clean(row[1])) amount=D(clean(row[4])) weighted_vials=D('.30')*10+D('.65')*20+D('.05')*30 vials=patients*weighted_vials print('Cost model vials and USD',int(vials),amount) w=xlrd.open_workbook('/work/award16.xls') s=w.sheet_by_name('Pharma') start=next(i for i in range(s.nrows) if 'DHS/P/WW/20/16' in s.cell_value(i,0)) total_vials=0 total_value=D(0) for i in [start,start+1]: pack,count=map(int,re.findall(r'\d+',s.cell_value(i,2).replace(',',''))) n=pack*count price=D(re.search(r'USD\s*([0-9.]+)',s.cell_value(i,4)).group(1)) total_vials+=n total_value+=n*price print('2016 tender vials and USD',total_vials,total_value) print('model-to-award volume, price, value ratios', *(round(float(v),3) for v in (vials/total_vials,(amount/vials)/(total_value/total_vials),amount/total_value))) for file,tender in [('award23.xlsx','DHS/P/WW/12/23'),('award25.xlsx','DHS/P/WW/245/25'),('award26.xlsx','DHS/P/WW/350/26')]: w=openpyxl.load_workbook('/work/'+file,read_only=True,data_only=True) rows=[r for s in w for r in s.values if len(r)>=12 and str(r[2]).strip()=='00602301' and str(r[4]).strip()==tender] assert rows and all(r[9]=='USD' and r[11]==1 for r in rows) qty=sum(r[8] for r in rows) price=sum(D(str(r[8]))*D(str(r[10])) for r in rows) print(tender,'vials and USD',int(qty),price) print('monthly reference, annual, annual low/high if nearest tenth', round(2660/.3),round(12*2660/.3),round(12*2660/.35),round(12*2660/.25)) ```
↑