From 896008340af2b8c8cedc2b4154d4c46e79c633d3 Mon Sep 17 00:00:00 2001 From: Marcia Schulman Date: Thu, 15 Aug 2024 10:13:47 -0400 Subject: [PATCH] update Readme --- README.md | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b71cd74..2b6b98f 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,18 @@ The main class for this is the ProfileManager. This class requires a ProfileFetc Usually, ProfileFetchers will be implemented by subsequent projects using this library. For example, if you store your profiles on S3 buckets in AWS, a ProfileFetcher implementation should be provided that can read those profiles. -A simple ResourceFileFetcher implementation is provided, where it can read profiles from the /src/main/resources folder. +The ProfileFetcher interface has the following methods that need to be implemented: +```kotlin +interface ProfileFetcher { + @Throws(InvalidFileException::class) + fun getFile(file: String, req: Boolean): String? + + @Throws(InvalidFileException::class) + fun getFileAsInputStream(file: String, req: Boolean): InputStream? +} +``` + +A simple ResourceFileFetcher implementation is provided that will read profiles from the /src/main/resources folder. The ProfileManager provides a validate() method that receives the HL7 message to be validated as parameter and outputs a NistReport instance with the report of all errors and warnings encountered in the message. @@ -29,9 +40,12 @@ Profiles should be created with the IGAMT v2 tool (https://hl7v2.igamt-2.nist.go • (optional) SLICINGS.xml -Ultimately, it is up to the implementer of the ProfileFetcher how to store and manage those resources. The ResourceFileFetcher expects a subfolder for each profile name under /src/main/resources, and the XML files (named exactly as above, as profile fetching is case-sensitive) should be placed under that subfolder. +Ultimately, it is up to the implementer of the ProfileFetcher how to store and manage these XML files. +The provided ResourceFileFetcher implementation expects a subfolder for each profile name under /src/main/resources, +and the XML files (named exactly as above, case-sensitive) should be placed under that subfolder. -Ex.: under /src/test/resources, there's a folder named "TEST_PROF". This is the mock name of a profile used for our tests. Inside that folder, you will find the XML files mentioned above. +For example, under /src/test/resources, there is a folder named "TEST_PROF". This corresponds to the name of a profile +used for our unit tests. Inside that folder, you will find the XML files mentioned above. # NIST Dependency @@ -44,7 +58,7 @@ This project uses some 3rd party code from NIST. The source code is available at |Snelick, Robert D.| | (Fed) | |Hossam Tamri | | (Tech) | |Caroline Rosin | | (Fed) | -|Crouzier, Nicolas (Assoc) | | | +|Crouzier, Nicolas | | (Assoc) | ## Building this project