Skip to content

Commit

Permalink
Update ORU sample files (#884)
Browse files Browse the repository at this point in the history
* Updated 004_MN_ORU_R01_NBS final hl7

* Renamed files

* Updated transformed fhir messages

* Updated file name in test

* Fixed test

* Increased max request size

* Updated file path

* Extract hardcoded values

* Updated readme with naming convention
  • Loading branch information
basiliskus authored Feb 19, 2024
1 parent d3d131d commit ad0b663
Show file tree
Hide file tree
Showing 8 changed files with 20,696 additions and 9,019 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,13 @@

/** Creates the starting point of our API. Handles the registration of the domains. */
public class App {

private static final long MAX_REQUEST_SIZE = 2 * 1024 * 1024L; // 2 MB in bytes
private static final int PORT = 8080;
static final String HEALTH_API_ENDPOINT = "/health";

public static void main(String[] args) {
var app = Javalin.create().start(8080);
var app =
Javalin.create(config -> config.http.maxRequestSize = MAX_REQUEST_SIZE).start(PORT);

// apply this security header to all responses, but allow it to be overwritten by a specific
// endpoint by using `before` if needed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import java.nio.file.Path
class ResultTest extends Specification {
def resultClient = new EndpointClient("/v1/etor/results")

def labResultJsonFileString = Files.readString(Path.of("../examples/MN/004_MN_ORU_R01_NBS_1_translation_from_initial_hl7_ingestion.fhir"))
def labResultJsonFileString = Files.readString(Path.of("../examples/MN/004_MN_ORU_R01_NBS_1_hl7_translation.fhir"))

def submissionId = "submissionId"

Expand All @@ -18,15 +18,15 @@ class ResultTest extends Specification {

def "a result response is returned from the ETOR order endpoint"() {
given:
def expectedFhirResourceId = "Bundle/1705511861639940150.e2c69100-24af-4bbd-86bf-2f29be816edf"
def expectedJsonBody = JsonParsing.parse(labResultJsonFileString)

when:
def response = resultClient.submit(labResultJsonFileString, submissionId, true)
def parsedJsonBody = JsonParsing.parseContent(response)

then:
response.getCode() == 200
parsedJsonBody.fhirResourceId == expectedFhirResourceId
parsedJsonBody.fhirResourceId.contains(expectedJsonBody.id)
}

def "check that the rest of the message is unchanged except the parts we changed"() {
Expand Down
File renamed without changes.
Loading

0 comments on commit ad0b663

Please sign in to comment.