Skip to content

Commit

Permalink
Merge pull request #1 from CDCgov/profilefetch
Browse files Browse the repository at this point in the history
update Readme
  • Loading branch information
mscaldas2012 authored Aug 15, 2024
2 parents d3f4d12 + 8960083 commit b010688
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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
Expand All @@ -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

Expand Down

0 comments on commit b010688

Please sign in to comment.