@@ -89,7 +89,8 @@ const generateEvent = ({
8989 forceStatus = null ,
9090 id = null ,
9191 specialAppointmentOverride = null ,
92- forceInProgress = false
92+ forceInProgress = false ,
93+ seedDataProfile = null
9394} ) => {
9495 // Parse dates once
9596 const [ hours , minutes ] = config . clinics . simulatedTime . split ( ':' )
@@ -103,7 +104,10 @@ const generateEvent = ({
103104
104105 // Generate special appointment requirements for this event
105106 const specialAppointment =
106- specialAppointmentOverride || generateSpecialAppointment ( )
107+ specialAppointmentOverride ||
108+ generateSpecialAppointment ( {
109+ probability : seedDataProfile ?. specialAppointment ?. probability
110+ } )
107111 const hasSpecialAppointment = Boolean (
108112 specialAppointment ?. supportTypes ?. length
109113 )
@@ -268,7 +272,12 @@ const generateEvent = ({
268272 event . mammogramData = generateMammogramImages ( {
269273 startTime : actualStartTime ,
270274 isSeedData : true ,
271- config : participant . config
275+ config : participant . config ,
276+ scenarioWeights : seedDataProfile ?. mammogram ?. scenarioWeights ,
277+ imperfectChanceForTechnicalOrIncomplete :
278+ seedDataProfile ?. mammogram ?. imperfectChanceForTechnicalOrIncomplete ,
279+ notesForReaderChanceWithoutImperfect :
280+ seedDataProfile ?. mammogram ?. notesForReaderChanceWithoutImperfect
272281 } )
273282
274283 // Sync event status with mammogram completeness
@@ -295,7 +304,8 @@ const generateEvent = ({
295304 // Generate previous mammograms (reported mammograms from other facilities)
296305 const previousMammograms = generatePreviousMammograms ( {
297306 eventDate : event . timing . actualEndTime || event . timing . actualStartTime ,
298- addedByUserId : event . sessionDetails . startedBy
307+ addedByUserId : event . sessionDetails . startedBy ,
308+ rate : seedDataProfile ?. previousMammograms ?. rate
299309 } )
300310 if ( previousMammograms ) {
301311 event . previousMammograms = previousMammograms
@@ -306,6 +316,7 @@ const generateEvent = ({
306316 const medicalInformation = generateMedicalInformation ( {
307317 addedByUserId : event . sessionDetails . startedBy ,
308318 config : participant . config ,
319+ ...( seedDataProfile ?. medicalInformation || { } ) ,
309320 // Allow config to override probabilities for test scenarios
310321 ...( participant . config ?. medicalInformation || { } )
311322 } )
@@ -322,6 +333,7 @@ const generateEvent = ({
322333 const medicalInformation = generateMedicalInformation ( {
323334 addedByUserId : event . sessionDetails . startedBy ,
324335 config : participant . config ,
336+ ...( seedDataProfile ?. medicalInformation || { } ) ,
325337 // Allow config to override probabilities for test scenarios
326338 ...( participant . config ?. medicalInformation || { } )
327339 } )
@@ -336,7 +348,12 @@ const generateEvent = ({
336348 event . mammogramData = generateMammogramImages ( {
337349 startTime : dayjs ( event . sessionDetails . startedAt ) ,
338350 isSeedData : true ,
339- config : participant . config
351+ config : participant . config ,
352+ scenarioWeights : seedDataProfile ?. mammogram ?. scenarioWeights ,
353+ imperfectChanceForTechnicalOrIncomplete :
354+ seedDataProfile ?. mammogram ?. imperfectChanceForTechnicalOrIncomplete ,
355+ notesForReaderChanceWithoutImperfect :
356+ seedDataProfile ?. mammogram ?. notesForReaderChanceWithoutImperfect
340357 } )
341358 }
342359 }
@@ -369,7 +386,11 @@ const generateEvent = ({
369386 // Select image set for events with mammogram data
370387 // Done at the end so full event context (symptoms, implants, etc.) is available
371388 if ( event . mammogramData ) {
372- const selectedSet = getImageSetForEvent ( event . id , 'diagrams' , { event } )
389+ const selectedSet = getImageSetForEvent ( event . id , 'diagrams' , {
390+ event,
391+ contextualWeights :
392+ seedDataProfile ?. imageSetSelection ?. contextualTagWeights
393+ } )
373394 if ( selectedSet ) {
374395 event . mammogramData . selectedSetId = selectedSet . id
375396 }
0 commit comments