Skip to content

Commit

Permalink
Merge pull request #8 from tomkaith13/add-appt-start-and-end
Browse files Browse the repository at this point in the history
adding start and end times to appt resource
  • Loading branch information
tomkaith13 authored Oct 13, 2023
2 parents f67209f + fac1816 commit 8149864
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/main/java/org/mitre/synthea/export/FhirR4.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import java.awt.geom.Point2D;
import java.io.IOException;
import java.time.Instant;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Arrays;
Expand All @@ -23,6 +24,7 @@
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.ThreadLocalRandom;
import java.util.stream.Collectors;

import org.apache.commons.codec.digest.DigestUtils;
Expand Down Expand Up @@ -781,13 +783,22 @@ private static BundleEntryComponent encounterAppointment(Person person, BundleEn

}

//start and end
LocalDateTime start = LocalDateTime.now().minusHours((long) (Math.random() * (10)));
LocalDateTime end = start.plusHours(1);

apptResource.setStart(java.sql.Timestamp.valueOf(start));
apptResource.setEnd(java.sql.Timestamp.valueOf(end));

apptResource.setParticipant(aPList);


return newEntry(bundle, apptResource, apptResource.getId());

}



/**
* Convert the given Person into a JSON String, containing a FHIR Bundle of the Person and the
* associated entries from their health record.
Expand Down

0 comments on commit 8149864

Please sign in to comment.