-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generate valid XON when the FHIR Organization identifier has no system
Fixes #165
- Loading branch information
Showing
3 changed files
with
42 additions
and
5 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
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
32 changes: 32 additions & 0 deletions
32
src/test/java/ch/bfh/ti/i4mi/mag/mhd/iti65/Iti65RequestConverterTest.java
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package ch.bfh.ti.i4mi.mag.mhd.iti65; | ||
|
||
import ca.uhn.hl7v2.HL7Exception; | ||
import org.hl7.fhir.r4.model.Organization; | ||
import org.junit.jupiter.api.Test; | ||
import org.openehealth.ipf.commons.ihe.xds.core.metadata.Hl7v2Based; | ||
|
||
import static org.junit.jupiter.api.Assertions.*; | ||
|
||
/** | ||
* MobileAccessGateway | ||
* | ||
* @author Quentin Ligier | ||
**/ | ||
class Iti65RequestConverterTest { | ||
|
||
@Test | ||
void testTransformOrganization() { | ||
Iti65RequestConverter iti65RequestConverter = new Iti65RequestConverter(); | ||
|
||
final var org = new Organization(); | ||
org.setName("Test"); | ||
org.addIdentifier().setValue("1234"); | ||
|
||
var xon = iti65RequestConverter.transform(org); | ||
assertEquals("Test^^^^^^^^^1234", Hl7v2Based.render(xon)); | ||
|
||
org.getIdentifierFirstRep().setSystem("urn:oid:1.2.3"); | ||
xon = iti65RequestConverter.transform(org); | ||
assertEquals("Test^^^^^&1.2.3&ISO^^^^1234", Hl7v2Based.render(xon)); | ||
} | ||
} |