Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 939d941c authored by Alexandre Pocinho's avatar Alexandre Pocinho
Browse files

Correct path to one folder in UT + add 2 UT's related to code not found error

parent 928436c0
No related branches found
No related tags found
2 merge requests!69release 3.10.0,!68[HLVAL-481] Wrong validation constraints in [eHDSI HL7v3] - Identification...
Showing
with 45 additions and 1 deletion
...@@ -17,7 +17,9 @@ public class GVTtoGazelleValidationReportMapperTest { ...@@ -17,7 +17,9 @@ public class GVTtoGazelleValidationReportMapperTest {
private final String PATHPROFILE_IRELAND = "src/test/resources/messageprofiles/ADT_A03_ADT_A03/"; private final String PATHPROFILE_IRELAND = "src/test/resources/messageprofiles/ADT_A03_ADT_A03/";
private final String PATHPROFILE_INTEROP = "src/test/resources/messageprofiles/ZAM^Z01_AlertCNF/"; private final String PATHPROFILE_INTEROP = "src/test/resources/messageprofiles/ZAM^Z01_AlertCNF/";
private final String PATHPROFILE_INTEROP_2 = "src/test/resources/messageprofiles/ MDM^T02^MDM_T02/"; private final String PATHPROFILE_INTEROP_2 = "src/test/resources/messageprofiles/MDM^T02^MDM_T02/";
private final String PATHPROFILE_INTEROP_3 = "src/test/resources/messageprofiles/ADT^A28^ADT_A05/";
private final String ER7INCORRECTMESSAGE = "MSH|^~\\&|TOREX.HEALTHLINK.12|MATER MISERICORDIAE HOSPITAL^908^L||Smyth, Michael^987654^Medical" + private final String ER7INCORRECTMESSAGE = "MSH|^~\\&|TOREX.HEALTHLINK.12|MATER MISERICORDIAE HOSPITAL^908^L||Smyth, Michael^987654^Medical" +
" Council No|200805281125||ADT^A03|1633796|P|2.4\n" + " Council No|200805281125||ADT^A03|1633796|P|2.4\n" +
...@@ -82,6 +84,32 @@ public class GVTtoGazelleValidationReportMapperTest { ...@@ -82,6 +84,32 @@ public class GVTtoGazelleValidationReportMapperTest {
} }
@Test
public void testConvertGVTReportToGazelleReportCodeNotFound() throws IOException {
String pathMessage = "src/test/resources/messages_examples/message_iti30_SHN.txt";
String content = new String(Files.readAllBytes(Paths.get(pathMessage)), StandardCharsets.UTF_8);
gvtValidator = new GVTValidator(PATHPROFILE_INTEROP_3, content);
gvtValidator.validateMessage(hl7v2ValidationReport);
List<Object> notifications = hl7v2ValidationReport.getResults().getNotifications();
List<Warning> warnings = extractWarningsWithSpecificGazelleError(notifications, GazelleErrorCode.CODE_NOT_FOUND);
Assert.assertEquals(1, warnings.size());
Assert.assertEquals("FAILED", hl7v2ValidationReport.getOverview().getValidationTestResult());
}
@Test
public void testConvertGVTReportToGazelleReportCodeNotFound2() throws IOException {
String pathMessage = "src/test/resources/messages_examples/message_iti30_FRA.txt";
String content = new String(Files.readAllBytes(Paths.get(pathMessage)), StandardCharsets.UTF_8);
gvtValidator = new GVTValidator(PATHPROFILE_INTEROP_3, content);
gvtValidator.validateMessage(hl7v2ValidationReport);
List<Object> notifications = hl7v2ValidationReport.getResults().getNotifications();
List<Warning> warnings = extractWarningsWithSpecificGazelleError(notifications, GazelleErrorCode.CODE_NOT_FOUND);
Assert.assertEquals(1, warnings.size());
Assert.assertEquals("PASSED", hl7v2ValidationReport.getOverview().getValidationTestResult());
}
private List<Warning> extractWarningsWithSpecificGazelleError(List<Object> notifications, GazelleErrorCode givenGazelleErrorCode) { private List<Warning> extractWarningsWithSpecificGazelleError(List<Object> notifications, GazelleErrorCode givenGazelleErrorCode) {
List<Warning> warnings = new ArrayList<>(); List<Warning> warnings = new ArrayList<>();
......
<CoConstraintContext xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/usnistgov/hl7-v2-schemas/1.7.0/src/main/resources/hl7-v2-schemas/CoConstraintContext.xsd" ID="b6ab96cb-8ff7-4f01-9c46-d51d4e60e01b" />
\ No newline at end of file
<ConformanceContext xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/usnistgov/hl7-v2-schemas/1.7.0/src/main/resources/hl7-v2-schemas/ConformanceContext.xsd" UUID="709b4fa9-a641-4840-b530-e3eec0ab89c5"><MetaData Name="PAM IHE + PAM FR" OrgName="No Org Info" Version="2.5" Date="No Date Info" /><Predicates><Datatype><ByID ID="HD_IHE_ISO"><Predicate Target="2[1]" TrueUsage="R" FalseUsage="O"><Description>If HD.3 (Universal ID Type) is valued </Description><Condition><Presence Path="3[1]" /></Condition></Predicate><Predicate Target="3[1]" TrueUsage="R" FalseUsage="O"><Description>If HD.2 (Universal ID) is valued </Description><Condition><Presence Path="2[1]" /></Condition></Predicate></ByID><ByID ID="HD_IHE_MSH"><Predicate Target="2[1]" TrueUsage="R" FalseUsage="O"><Description>If HD.3 (Universal ID Type) is valued </Description><Condition><Presence Path="3[1]" /></Condition></Predicate><Predicate Target="3[1]" TrueUsage="R" FalseUsage="O"><Description>If HD.2 (Universal ID) is valued </Description><Condition><Presence Path="2[1]" /></Condition></Predicate></ByID><ByID ID="EI_IHE"><Predicate Target="2[1]" TrueUsage="R" FalseUsage="O"><Description>If ( EI.3 (Universal ID) is not valued AND EI.4 (Universal ID Type) is not valued )</Description><Condition><AND><NOT><Presence Path="4[1]" /></NOT><NOT><Presence Path="3[1]" /></NOT></AND></Condition></Predicate><Predicate Target="3[1]" TrueUsage="R" FalseUsage="O"><Description>If ( EI.2 (Namespace ID) is not valued OR EI.4 (Universal ID Type) is valued )</Description><Condition><OR><Presence Path="4[1]" /><NOT><Presence Path="2[1]" /></NOT></OR></Condition></Predicate><Predicate Target="4[1]" TrueUsage="R" FalseUsage="O"><Description>If ( EI.2 (Namespace ID) is not valued AND EI.3 (Universal ID) is valued )</Description><Condition><AND><NOT><Presence Path="2[1]" /></NOT><Presence Path="3[1]" /></AND></Condition></Predicate></ByID></Datatype><Segment><ByID ID="OBX_IHE"><Predicate Target="2[1]" TrueUsage="R" FalseUsage="O"><Description>If OBX-5 (Observation Value) is valued </Description><Condition><Presence Path="5[1]" /></Condition></Predicate><Predicate Target="5[1]" TrueUsage="R" FalseUsage="O"><Description>If ( OBX-11 (Observation Result Status) does not contain one of the values in the list: ['D','N','X','I'] (Case Sensitive). AND OBX-8 (Abnormal Flags) is not valued )</Description><Condition><AND><NOT><StringList Path="11[1]" CSV="D,N,X,I" IgnoreCase="false" NotPresentBehavior="FAIL" /></NOT><NOT><Presence Path="8[1]" /></NOT></AND></Condition></Predicate></ByID></Segment><Group /><Message /></Predicates><Constraints><Datatype><ByID ID="TM"><Constraint ID="TM_DateTimeConstraint"><Description>The value SHALL follow the Date/Time pattern 'HH[MM[SS[.S[S[S[S]]]]]][+/-ZZZZ]'.</Description><Assertion><Format Path="." Regex="^(\d{2}|\d{4}|\d{6}|\d{6}\.\d|\d{6}\.\d{2}|\d{6}\.\d{3}|\d{6}\.\d{4})([+-]\d{4})?$" /></Assertion></Constraint></ByID><ByID ID="DT"><Constraint ID="DT_DateTimeConstraint"><Description>The value SHALL follow the Date/Time pattern 'YYYY[MM[DD]]'.</Description><Assertion><Format Path="." Regex="^(\d{4}|\d{6}|\d{8})$" /></Assertion></Constraint></ByID><ByID ID="DTM"><Constraint ID="DTM_DateTimeConstraint"><Description>The value SHALL follow the Date/Time pattern 'YYYY[MM[DD[HH[MM[SS[.S[S[S[S]]]]]]]]][+/-ZZZZ]'.</Description><Assertion><Format Path="." Regex="^(\d{4}|\d{6}|\d{8}|\d{10}|\d{12}|\d{14}|\d{14}\.\d|\d{14}\.\d{2}|\d{14}\.\d{3}|\d{14}\.\d{4})([+-]\d{4})?$" /></Assertion></Constraint></ByID></Datatype><Segment /><Group /><Message /></Constraints></ConformanceContext>
\ No newline at end of file
<ProfileSlicing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/usnistgov/hl7-v2-schemas/1.7.0/src/main/resources/hl7-v2-schemas/ProfileSlicing.xsd" ID="96d8a813-3a66-4d5f-b1b4-ded0996da2e3" />
\ No newline at end of file
source diff could not be displayed: it is too large. Options to address this: view the blob.
MSH|^~\&|IHE|DEMOGRAPHIC|IHE|DEMOGRAPHIC|20230928113103||ADT^A28^ADT_A05|1000479038|P|2.5^FRA^2.10|||||FRA|8859/1|FR
EVN||20230928113103|||INT^ADMIN^ADM INTER^^^^^^CPAGE&1.3.6.1.4.1.21367.2011.2.5.5631&ISO|20230928113103
PID|||000000422049^^^CPAGE&1.2.250.1.211.10.200.2&ISO^PI||PAMSYSTEMTHREE^EF^EF^^M.^^L||20000101|M|||Rue Du Test^^DIJON^^21000^FRA^H~^^DIJON^21231^21000^FRA^BDL^^21231||^PRN^PH^^^^^^^^^0380123456|||U^^HL70002||||||||N||FRA^ISO 3166 alpha-3||||N||AL||700004591^2.16.840.1.113883.19^ISO
PD1||||||||||||N
PV1||N
\ No newline at end of file
MSH|^?\&|||||20240605134541||ADT^A28^ADT_A05|20240605134541|P|2.5||||||UNICODE UTF-8
EVN||20240605134541||||20240605134552
PID|||DDS-74770^^^DDS&1.3.6.1.4.1.12559.11.1.4.1.2&ISO^PI||Pamsystem^Ab^^^^^L|??^^^^^^M|19640721|M|||?????^^Numazu^^410-0832^JPN^H||||||SHN|AN12072^^^IHEPAM&1.3.6.1.4.1.12559.11.1.2.2.5&ISO^AN|||||||||||||N
PV1||N
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment