GHS Prices Update - Annual Process
This document describes the annual process for updating GHS (Groupes Homogènes de Séjours) prices and grouping tables when new versions are published by the French health authorities.
Overview
The French health authorities typically publish new GHS tables around May each year, with retroactive effect to March of the same year. This creates a transition period where we need to carefully manage the update process.
Problem Statement
- Publication Timing: New 20XX tables are published late (around May 20XX)
- Retroactive Application: Tables are retroactive to March 20XX
- Technical Constraint: Setting cutoff to January 1st would cause errors (table not available yet)
- Current Solution: Use June 1st as cutoff to ensure table is published before activation
Annual Update Process
1. Preparation Phase (Before May)
Set Up Next Year's Cutoff Date
In the coding service, the cutoff dates are pre-configured with conservative dates:
// services/coding/src/domain-layer/coding/coding.constants.ts
export const GROUPING_CUTOFF_DATES = [
{ cutoffDate: new Date('2025-01-01'), referenceYear: 2025 },
{ cutoffDate: new Date('2026-06-01'), referenceYear: 2026 }, // Conservative date
{ cutoffDate: new Date('2027-06-01'), referenceYear: 2027 }, // Conservative date
];The June 1st date provides a buffer period after the expected May publication.
2. Data Collection Phase (May - After Publication)
Obtain the Official GHS Tables
- Download the official GHS price tables from ATIH (Agence Technique de l'Information sur l'Hospitalisation)
- Convert the data to the required JSON format
- Save as
ghs-YYYY-prices.jsonin the valuation service
Required Data Format
[
{
"ghsCode": 1234,
"referenceYear": 2025,
"ghm": "01M01Z",
"description": "Description of the GHM",
"upperDayCountThreshold": 10,
"lowerDayCountThreshold": 2,
"upperExtremePrice": 5000.0,
"lowerExtremePrice": 1000.0,
"defaultPrice": 3000.0
}
]3. Database Update Phase
Step 1: Prepare the Seed File
Place the new prices file in the valuation service:
services/valuation/prisma/seed/seed-data/ghs-YYYY-prices.jsonStep 2: Create/Update Population Script
If needed, create a new population script (or update the existing one):
// services/valuation/prisma/scripts/populate-prices-YYYY.ts
export async function populatePricesYYYY(prisma: PrismaClient) {
const filePath = path.resolve(
__dirname,
'../seed/seed-data/ghs-YYYY-prices.json',
);
const ghsPrices: IPriceRow[] = JSON.parse(fs.readFileSync(filePath, 'utf8'));
console.log(`Seeding ${ghsPrices.length} GHS prices...`);
await runPromisesInParallelBatches<IPriceRow, void>(
ghsPrices,
async (price) => {
await prisma.price.upsert({
where: {
ghsCode_referenceYear: {
ghsCode: price.ghsCode,
referenceYear: price.referenceYear,
},
},
update: priceData,
create: priceData,
});
},
50,
);
}Step 3: Run the Population Script
- Update the main script to import and call the new function:
// services/valuation/prisma/scripts/index.ts
import { populatePricesYYYY } from './populate-prices-YYYY';
async function main() {
console.log('Running Prisma scripts...');
await populatePricesYYYY(new PrismaClient());
}- Execute the script:
cd services/valuation
npx ts-node prisma/scripts/index.ts4. Cutoff Date Update Phase
Update the Cutoff Date to Retroactive Date
Once the table is successfully loaded in the database, update the cutoff date to the actual retroactive date (typically March):
// services/coding/src/domain-layer/coding/coding.constants.ts
export const GROUPING_CUTOFF_DATES = [
{ cutoffDate: new Date('2025-01-01'), referenceYear: 2025 },
{ cutoffDate: new Date('2026-03-01'), referenceYear: 2026 }, // Updated to retroactive date
{ cutoffDate: new Date('2027-06-01'), referenceYear: 2027 },
];5. Recomputation Phase
Trigger Recomputation of Existing Groupings
After updating the cutoff date, existing medical stays that fall within the retroactive period need to be recomputed:
Identify Affected Records: Find all medical stays with discharge dates between the new cutoff date (e.g., March 1st) and the old cutoff date (e.g., June 1st)
Trigger Re-evaluation: For each affected optimization, trigger a re-evaluation to recalculate the GHM and pricing using the new tables
Monitor Progress: Track the recomputation process to ensure all affected records are updated
WARNING
The specific recomputation script is to be developed. This process should:
- Query affected medical stays
- Re-trigger grouping calculations
- Update optimization gains
- Emit appropriate events