File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -69,6 +69,16 @@ export function getScheduleSummary({
6969 const atScheduleMax = nextSequence > MMR_MAX_SEQUENCE
7070 const createdAt = new Date ( vaccination . createdAt )
7171
72+ if ( lastValidCreatedAt ) {
73+ const gap = differenceInCalendarDays ( createdAt , lastValidCreatedAt )
74+ if ( gap < MMR_MIN_INTERVAL_DAYS ) {
75+ const reason = REASON . LessThan28DaysAfterPrevious
76+ ignoredDoses . push ( { vaccination, reason } )
77+ recordedDoses . push ( { vaccination, kind : 'ignored' , reason } )
78+ continue
79+ }
80+ }
81+
7282 if ( ! atScheduleMax ) {
7383 const minAgeDate = addMonths ( dob , MMR_MIN_AGE_MONTHS [ nextSequence ] )
7484
@@ -83,16 +93,6 @@ export function getScheduleSummary({
8393 }
8494 }
8595
86- if ( lastValidCreatedAt ) {
87- const gap = differenceInCalendarDays ( createdAt , lastValidCreatedAt )
88- if ( gap < MMR_MIN_INTERVAL_DAYS ) {
89- const reason = REASON . LessThan28DaysAfterPrevious
90- ignoredDoses . push ( { vaccination, reason } )
91- recordedDoses . push ( { vaccination, kind : 'ignored' , reason } )
92- continue
93- }
94- }
95-
9696 if ( atScheduleMax ) {
9797 const reason = REASON . ExtraDose
9898 ignoredDoses . push ( { vaccination, reason } )
You can’t perform that action at this time.
0 commit comments