generated from CDCgov/template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from CDCgov/profilefetch
update Readme
- Loading branch information
Showing
1 changed file
with
18 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 <code>/src/main/resources</code> 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 <code>/src/main/resources</code> folder. | ||
|
||
The ProfileManager provides a <code>validate()</code> 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.| <[email protected]> | (Fed) | | ||
|Hossam Tamri | <[email protected]> | (Tech) | | ||
|Caroline Rosin | <[email protected]> | (Fed) | | ||
|Crouzier, Nicolas (Assoc) | <[email protected]> | | | ||
|Crouzier, Nicolas | <[email protected]> | (Assoc) | | ||
|
||
## Building this project | ||
|
||
|